diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0afc1f9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +name: CI + +# This code drives hardware or needs large models, so there is nothing to run +# here. The check catches what would crash when the code runs: syntax errors +# and names that are used but never defined (flake8 E9, F63, F7, F821-F823). +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-python@v7 + with: + python-version: "3.13" + - run: python -m pip install flake8==7.5.0 + - name: Every Python file compiles + run: python -m compileall -q . + - name: No syntax errors or undefined names + # --isolated ignores any [flake8] section in setup.cfg or tox.ini. + run: >- + flake8 --isolated --show-source --statistics + --select=E9,F63,F7,F821,F822,F823 + .