ci: migrate from taskcluster to github actions #10
Workflow file for this run
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: Python CI | |
| on: | |
| pull_request: | |
| branches: [ master ] | |
| push: | |
| branches: [ master ] | |
| release: | |
| types: [ released ] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| name: Lint | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install Poetry | |
| uses: ./.github/actions/setup-poetry | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cache/pypoetry | |
| ~/.cache/pip | |
| key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-poetry- | |
| - name: Install dependencies | |
| run: poetry install | |
| - name: Install tox | |
| run: python -m pip install --upgrade tox | |
| - name: Run lint | |
| run: tox -e lint | |
| test: | |
| name: Python ${{ matrix.python-version }} (${{ matrix.platform }}) | |
| needs: lint | |
| runs-on: ${{ matrix.platform }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - python-version: "3.9" | |
| platform: ubuntu-latest | |
| toxenv: py39 | |
| - python-version: "3.10" | |
| platform: ubuntu-latest | |
| toxenv: py310 | |
| - python-version: "3.11" | |
| platform: ubuntu-latest | |
| toxenv: py311 | |
| - python-version: "3.12" | |
| platform: ubuntu-latest | |
| toxenv: py312 | |
| - python-version: "3.13" | |
| platform: ubuntu-latest | |
| toxenv: py313 | |
| - python-version: "3.12" | |
| platform: macos-latest | |
| toxenv: py312 | |
| - python-version: "3.12" | |
| platform: windows-latest | |
| toxenv: py312 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install Poetry | |
| uses: ./.github/actions/setup-poetry | |
| - name: Install dependencies | |
| run: poetry install | |
| - name: Install tox | |
| run: python -m pip install --upgrade tox | |
| - name: Run tests | |
| run: tox -e ${{ matrix.toxenv }} | |
| - name: Run Codecov | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| run: tox -e codecov | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| if: github.ref == 'refs/heads/master' && github.event_name == 'push' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install Poetry | |
| uses: ./.github/actions/setup-poetry | |
| - name: Install dependencies | |
| run: poetry install | |
| - name: Run semantic-release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: poetry run semantic-release publish |