|
| 1 | +name: Build |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +env: |
| 6 | + FORCE_COLOR: 1 |
| 7 | + RUFF_OUTPUT_FORMAT: github |
| 8 | + |
| 9 | +jobs: |
| 10 | + test: |
| 11 | + runs-on: ${{ matrix.os }} |
| 12 | + continue-on-error: ${{ matrix.python_version == '3.14' }} |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + python_version: ["3.13", "3.14"] |
| 16 | + os: ["ubuntu-latest", "macos-latest", "windows-latest"] |
| 17 | + steps: |
| 18 | + - name: Check out repository |
| 19 | + uses: actions/checkout@v6 |
| 20 | + |
| 21 | + - name: Set up Python ${{ matrix.python_version }} |
| 22 | + uses: actions/setup-python@v6 |
| 23 | + with: |
| 24 | + python-version: ${{ matrix.python_version }} |
| 25 | + allow-prereleases: true |
| 26 | + |
| 27 | + - name: Install uv |
| 28 | + uses: astral-sh/setup-uv@v7 |
| 29 | + with: |
| 30 | + enable-cache: true |
| 31 | + cache-dependency-glob: pyproject.toml |
| 32 | + cache-suffix: py${{ matrix.python_version }} |
| 33 | + |
| 34 | + - name: Install dependencies (uv sync) |
| 35 | + run: uv sync --all-extras --no-group docs --no-group lint |
| 36 | + |
| 37 | + - name: Check for code issues (ruff check) |
| 38 | + uses: astral-sh/ruff-action@v3 |
| 39 | + |
| 40 | + - name: Check code format (ruff format) |
| 41 | + uses: astral-sh/ruff-action@v3 |
| 42 | + with: |
| 43 | + args: "format --check" |
| 44 | + |
| 45 | + - name: Static type checking (MyPy) |
| 46 | + run: uv run --no-group docs mypy src/exxec/ |
| 47 | + |
| 48 | + - name: Run tests |
| 49 | + run: uv run --no-group docs pytest --cov-report=xml --cov=src/exxec/ --cov-report=term-missing |
| 50 | + |
| 51 | + - name: Upload test results to Codecov |
| 52 | + uses: codecov/codecov-action@v5 |
| 53 | + with: |
| 54 | + fail_ci_if_error: false |
| 55 | + verbose: true |
| 56 | + |
| 57 | + release: |
| 58 | + runs-on: ubuntu-latest |
| 59 | + needs: test |
| 60 | + if: startsWith(github.ref, 'refs/tags/') |
| 61 | + permissions: |
| 62 | + # this permission is mandatory for trusted publishing |
| 63 | + id-token: write |
| 64 | + contents: write |
| 65 | + steps: |
| 66 | + - name: Check out repository |
| 67 | + uses: actions/checkout@v6 |
| 68 | + |
| 69 | + - name: Set up Python |
| 70 | + uses: actions/setup-python@v6 |
| 71 | + with: |
| 72 | + python-version: "3.13" |
| 73 | + |
| 74 | + - name: Install uv |
| 75 | + uses: astral-sh/setup-uv@v7 |
| 76 | + with: |
| 77 | + enable-cache: true |
| 78 | + cache-dependency-glob: pyproject.toml |
| 79 | + cache-suffix: py${{ matrix.python_version }} |
| 80 | + |
| 81 | + - name: Build package |
| 82 | + run: uv build |
| 83 | + |
| 84 | + - name: Publish package distributions to PyPI |
| 85 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 86 | + |
| 87 | + - name: Release package on GitHub |
| 88 | + uses: ncipollo/release-action@v1 |
| 89 | + with: |
| 90 | + body: ${{ github.event.head_commit.message }} |
| 91 | + artifacts: dist/*.whl,dist/*.tar.gz |
| 92 | + token: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments