diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml new file mode 100644 index 0000000..11c7c9c --- /dev/null +++ b/.github/workflows/python-ci.yml @@ -0,0 +1,41 @@ +name: Python CI + +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +permissions: + contents: read + +concurrency: + group: python-ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + timeout-minutes: 25 + + steps: + - uses: actions/checkout@v6 + + - uses: actions/setup-python@v6 + with: + python-version: "3.11" + cache: pip + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + if [ -f pyproject.toml ]; then pip install -e ".[dev]" || pip install -e . || true; fi + if [ -d tests ]; then pip install pytest; fi + + - name: Compile + run: python -m compileall . + + - name: Test + run: | + if [ -d tests ]; then pytest; else echo "No tests directory; compile check passed."; fi