|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + |
| 12 | +concurrency: |
| 13 | + group: ci-${{ github.ref }} |
| 14 | + cancel-in-progress: true |
| 15 | + |
| 16 | +env: |
| 17 | + DOTNET_NOLOGO: true |
| 18 | + DOTNET_CLI_TELEMETRY_OPTOUT: true |
| 19 | + |
| 20 | +jobs: |
| 21 | + dotnet: |
| 22 | + name: .NET (${{ matrix.os }}) |
| 23 | + strategy: |
| 24 | + fail-fast: false |
| 25 | + matrix: |
| 26 | + os: [ubuntu-latest, windows-latest] |
| 27 | + runs-on: ${{ matrix.os }} |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v7 |
| 30 | + |
| 31 | + - uses: actions/setup-dotnet@v6 |
| 32 | + with: |
| 33 | + global-json-file: global.json |
| 34 | + |
| 35 | + # The integration tests build the psrunner wheel and create real Python environments with uv. |
| 36 | + - uses: astral-sh/setup-uv@v10 |
| 37 | + |
| 38 | + - name: Restore |
| 39 | + run: dotnet restore |
| 40 | + |
| 41 | + - name: Build |
| 42 | + run: dotnet build --no-restore --configuration Release |
| 43 | + |
| 44 | + - name: Test |
| 45 | + run: dotnet test --no-build --configuration Release |
| 46 | + |
| 47 | + format: |
| 48 | + name: .NET format |
| 49 | + runs-on: ubuntu-latest |
| 50 | + steps: |
| 51 | + - uses: actions/checkout@v7 |
| 52 | + |
| 53 | + - uses: actions/setup-dotnet@v6 |
| 54 | + with: |
| 55 | + global-json-file: global.json |
| 56 | + |
| 57 | + - name: Verify formatting |
| 58 | + run: dotnet format --verify-no-changes |
| 59 | + |
| 60 | + python-sdk: |
| 61 | + name: psrunner (${{ matrix.os }}, Python ${{ matrix.python }}) |
| 62 | + strategy: |
| 63 | + fail-fast: false |
| 64 | + matrix: |
| 65 | + os: [ubuntu-latest] |
| 66 | + python: ['3.10', '3.11', '3.12', '3.13'] |
| 67 | + include: |
| 68 | + # Windows only on the default version to save Actions minutes. |
| 69 | + - os: windows-latest |
| 70 | + python: '3.12' |
| 71 | + runs-on: ${{ matrix.os }} |
| 72 | + defaults: |
| 73 | + run: |
| 74 | + working-directory: python/psrunner |
| 75 | + steps: |
| 76 | + - uses: actions/checkout@v7 |
| 77 | + |
| 78 | + - uses: astral-sh/setup-uv@v10 |
| 79 | + with: |
| 80 | + python-version: ${{ matrix.python }} |
| 81 | + |
| 82 | + - name: Install |
| 83 | + run: uv sync --locked |
| 84 | + |
| 85 | + - name: Lint |
| 86 | + run: | |
| 87 | + uv run ruff check src tests |
| 88 | + uv run ruff format --check src tests |
| 89 | +
|
| 90 | + - name: Type check |
| 91 | + run: uv run mypy |
| 92 | + |
| 93 | + - name: Test |
| 94 | + run: uv run pytest |
0 commit comments