diff --git a/.github/workflows/lint_python.yaml b/.github/workflows/lint_python.yaml deleted file mode 100644 index a255673..0000000 --- a/.github/workflows/lint_python.yaml +++ /dev/null @@ -1,26 +0,0 @@ -name: Lint Python -on: - pull_request: - push: - repository_dispatch: - types: - - dispatched_test - -env: - ref: ${{ github.event.client_payload.ref || '' }} - -jobs: - lint_python: - name: Lint Python - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ env.ref }} - - uses: actions/setup-python@v1 - with: - python_version: "3.8" - - run: "python -m pip install git+https://github.com/pycqa/pyflakes@1911c20#egg=pyflakes git+https://github.com/pycqa/pycodestyle@d219c68#egg=pycodestyle git+https://gitlab.com/pycqa/flake8@3.7.9#egg=flake8" - name: Install Flake8 - - run: "python -m flake8 . --count --select=E9,F7,F82 --show-source" - name: Flake8 Linting diff --git a/.github/workflows/run_precommit.yml b/.github/workflows/run_precommit.yml new file mode 100644 index 0000000..bd0b2af --- /dev/null +++ b/.github/workflows/run_precommit.yml @@ -0,0 +1,33 @@ +name: Run pre-commit + +on: [push, pull_request] + +jobs: + run_precommit: + name: Run pre-commit + runs-on: ubuntu-latest + + steps: + # Checkout repository + - uses: actions/checkout@v2 + + # Setup Python and install pre-commit + - uses: actions/setup-python@v2 + with: + python_version: "3.8" + - name: Install pre-commit + run: | + pip install -U pre-commit + + # Load cached pre-commit environment + - name: set PY + run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV + - uses: actions/cache@v2 + with: + path: ~/.cache/pre-commit + key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} + + # Run pre-commit + - name: Run pre-commit + run: | + pre-commit run --show-diff-on-failure --color=never --all-files --verbose diff --git a/.github/workflows/style.yaml b/.github/workflows/style.yaml deleted file mode 100644 index 90b942f..0000000 --- a/.github/workflows/style.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: Style formatting - -on: [push, pull_request] - -jobs: - mypy: - name: Style check with Black - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: actions/setup-python@v1 - with: - python-version: "3.8" - - run: "python -m pip install black==19.10b0" - name: Install dependencies - - run: "make stylediff" - name: Run black