CI #133
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - v* | |
| pull_request: | |
| branches: | |
| - main | |
| schedule: | |
| # Run weekly on Mondays and Wednesdays 00:00 | |
| - cron: "0 0 * * MON,WED" | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python "3.12" | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install ruff | |
| - name: Check style with ruff | |
| run: | | |
| ruff check . --config ./pyproject.toml | |
| test: | |
| name: Test | |
| needs: [lint] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v3 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install '.[test]' | |
| - name: Run tests | |
| run: | | |
| pytest test --ignore=test/integration/ | |
| integration-tests: | |
| name: Integration Tests (Nightly) | |
| if: github.event_name == 'schedule' | |
| needs: [lint] | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v3 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install '.[integration]' | |
| - name: Run integration tests | |
| run: | | |
| pytest test/integration/ | |
| build: | |
| name: Build | |
| needs: [test] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.12" | |
| - name: Install Python build dependencies | |
| run: | | |
| python -m pip install --upgrade pip build wheel | |
| - name: Build wheels | |
| run: | | |
| python -m build | |
| - name: Upload wheels | |
| uses: actions/upload-artifact@v4 | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
| with: | |
| name: dist | |
| path: dist | |
| release: | |
| name: Release | |
| environment: release | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | |
| needs: [test, build, lint] | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: dist | |
| path: dist | |
| - name: Publish package | |
| uses: pypa/gh-action-pypi-publish@v1.12.4 |