|
| 1 | +name: 🔨 Install dependencies |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + branches: [main] |
| 6 | + |
| 7 | +jobs: |
| 8 | + install: |
| 9 | + name: 🔨 Install Python ${{ matrix.python-version }} on ${{ matrix.os }} |
| 10 | + runs-on: ${{ matrix.os }} |
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + os: [ubuntu-latest, windows-latest, macos-latest] |
| 14 | + python-version: ["3.12", "3.13", "3.14"] |
| 15 | + |
| 16 | + steps: |
| 17 | + - name: Checkout code |
| 18 | + uses: actions/checkout@v4 |
| 19 | + |
| 20 | + - name: Set up Python ${{ matrix.python-version }} |
| 21 | + uses: actions/setup-python@v4 |
| 22 | + with: |
| 23 | + python-version: ${{ matrix.python-version }} |
| 24 | + |
| 25 | + - name: Install uv |
| 26 | + uses: astral-sh/setup-uv@v2 |
| 27 | + |
| 28 | + - name: Build package |
| 29 | + run: | |
| 30 | + uv build |
| 31 | +
|
| 32 | + - name: Create isolated venv (Unix) |
| 33 | + if: runner.os != 'Windows' |
| 34 | + run: | |
| 35 | + uv venv .wheel-test-env --python "${{ matrix.python-version }}" |
| 36 | +
|
| 37 | + - name: Create isolated venv (Windows) |
| 38 | + if: runner.os == 'Windows' |
| 39 | + run: | |
| 40 | + uv venv .wheel-test-env --python "${{ matrix.python-version }}" |
| 41 | +
|
| 42 | + - name: Install wheel in isolated venv (Unix) |
| 43 | + if: runner.os != 'Windows' |
| 44 | + run: | |
| 45 | + uv pip install --python ./.wheel-test-env/bin/python dist/security_triage-*.whl |
| 46 | +
|
| 47 | + - name: Install wheel in isolated venv (Windows) |
| 48 | + if: runner.os == 'Windows' |
| 49 | + run: | |
| 50 | + $wheel = Get-ChildItem dist/*.whl | Select-Object -First 1 |
| 51 | + if (-not $wheel) { |
| 52 | + throw "No wheel file found in dist/" |
| 53 | + } |
| 54 | + uv pip install --python ./.wheel-test-env/Scripts/python.exe "$($wheel.FullName)" |
| 55 | +
|
| 56 | + - name: Verify installed package (Unix) |
| 57 | + if: runner.os != 'Windows' |
| 58 | + run: | |
| 59 | + ./.wheel-test-env/bin/python -c "from security_triage.cli import main; print('Package imports successfully')" |
| 60 | + ./.wheel-test-env/bin/security-triage --version |
| 61 | +
|
| 62 | + - name: Verify installed package (Windows) |
| 63 | + if: runner.os == 'Windows' |
| 64 | + run: | |
| 65 | + ./.wheel-test-env/Scripts/python.exe -c "from security_triage.cli import main; print('Package imports successfully')" |
| 66 | + $entrypoint = Get-ChildItem ./.wheel-test-env/Scripts/security-triage* | Select-Object -First 1 |
| 67 | + if (-not $entrypoint) { |
| 68 | + throw "Could not find installed security-triage entrypoint" |
| 69 | + } |
| 70 | + & $entrypoint.FullName --version |
0 commit comments