ci: add multhread pytest coverage collection #7
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: | |
| - dev2 | |
| pull_request: | |
| branches: | |
| - '**' | |
| env: | |
| PY_COLORS: "1" | |
| jobs: | |
| build: | |
| name: Build devcontainer image | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: esynr3z | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build image | |
| uses: devcontainers/ci@v0.3 | |
| with: | |
| imageName: ghcr.io/esynr3z/corsair-workspace | |
| cacheFrom: ghcr.io/esynr3z/corsair-workspace | |
| push: always | |
| test: | |
| name: Python ${{ matrix.python-version }} tests & checks | |
| runs-on: ubuntu-latest | |
| needs: build | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.10', '3.11', '3.12', '3.13'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Python ${{ matrix.python-version }} and project dependencies | |
| uses: devcontainers/ci@v0.3 | |
| with: | |
| cacheFrom: ghcr.io/esynr3z/corsair-workspace | |
| push: never | |
| runCmd: | | |
| uv venv -p ${{ matrix.python-version }} | |
| uv sync --all-extras --dev | |
| - name: Check branch commits | |
| uses: devcontainers/ci@v0.3 | |
| with: | |
| cacheFrom: ghcr.io/esynr3z/corsair-workspace | |
| push: never | |
| runCmd: | | |
| uv run poe check-commits | |
| - name: Check Python code format | |
| uses: devcontainers/ci@v0.3 | |
| if: always() | |
| with: | |
| cacheFrom: ghcr.io/esynr3z/corsair-workspace | |
| push: never | |
| runCmd: uv run poe check-format | |
| - name: Lint Python code | |
| uses: devcontainers/ci@v0.3 | |
| if: always() | |
| with: | |
| cacheFrom: ghcr.io/esynr3z/corsair-workspace | |
| push: never | |
| runCmd: uv run poe lint | |
| - name: Do type checking for Python code | |
| uses: devcontainers/ci@v0.3 | |
| if: always() | |
| with: | |
| cacheFrom: ghcr.io/esynr3z/corsair-workspace | |
| push: never | |
| runCmd: uv run poe check-types | |
| - name: Run all tests | |
| uses: devcontainers/ci@v0.3 | |
| if: always() | |
| with: | |
| cacheFrom: ghcr.io/esynr3z/corsair-workspace | |
| push: never | |
| runCmd: uv run poe test-cov |