|
3 | 3 | # label added. Any changes to the PR in need of a retriggering of the workflow require the removal and re-adding of the |
4 | 4 | # "safe to test" label. |
5 | 5 | # |
6 | | -# Since a subset of tests was already run in the nolicense workflow, this workflow runs skips the following tests: |
7 | | -# - Lint with flake8. |
| 6 | +# Since a subset of checks already ran in the nolicense workflow, this workflow skips linting here. |
8 | 7 |
|
9 | 8 | name: build and test PR, license required |
10 | 9 |
|
|
15 | 14 | permissions: |
16 | 15 | contents: read |
17 | 16 |
|
| 17 | +concurrency: |
| 18 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 19 | + cancel-in-progress: true |
| 20 | + |
18 | 21 | jobs: |
19 | | - build_pr_license: |
| 22 | + tests: |
20 | 23 | runs-on: ubuntu-latest |
21 | 24 | if: contains(github.event.pull_request.labels.*.name, 'safe to test') |
| 25 | + timeout-minutes: 45 |
22 | 26 | strategy: |
| 27 | + fail-fast: false |
23 | 28 | matrix: |
24 | | - python-version: ["3.9", "3.10", "3.11", "3.12"] |
25 | | - gurobi-version: ["gurobi10", "gurobi11","gurobi12"] |
| 29 | + python-version: ["3.10", "3.11", "3.12", "3.13"] |
| 30 | + gurobi-version: ["gurobi11","gurobi12","gurobi13"] |
26 | 31 | exclude: |
27 | | - - python-version: "3.12" |
28 | | - gurobi-version: "gurobi10" |
| 32 | + - python-version: "3.13" |
| 33 | + gurobi-version: "gurobi11" |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v5 |
| 36 | + with: |
| 37 | + ref: ${{ github.event.pull_request.head.sha }} |
| 38 | + - name: Setup Python |
| 39 | + uses: ./.github/actions/setup-python-and-install |
| 40 | + with: |
| 41 | + python-version: ${{ matrix.python-version }} |
| 42 | + - name: Setup uv |
| 43 | + uses: astral-sh/setup-uv@v3 |
| 44 | + - id: write-license |
| 45 | + name: Write license |
| 46 | + uses: ./.github/actions/write-license |
| 47 | + with: |
| 48 | + license: ${{ secrets.LICENSE }} |
| 49 | + - name: Test with tox (uv) |
| 50 | + env: |
| 51 | + GRB_LICENSE_FILE: ${{ steps.write-license.outputs.grb_license_file }} |
| 52 | + GUROBI_VERSION: ${{ matrix.gurobi-version }} |
| 53 | + run: | |
| 54 | + uvx tox |
| 55 | +
|
| 56 | + examples: |
| 57 | + runs-on: ubuntu-latest |
| 58 | + if: contains(github.event.pull_request.labels.*.name, 'safe to test') |
| 59 | + needs: tests |
| 60 | + timeout-minutes: 45 |
| 61 | + strategy: |
| 62 | + fail-fast: false |
| 63 | + matrix: |
| 64 | + python-version: ["3.12"] |
| 65 | + gurobi-version: ["gurobi11","gurobi12","gurobi13"] |
29 | 66 | steps: |
30 | | - - uses: actions/checkout@v5 |
31 | | - with: |
32 | | - ref: ${{ github.event.pull_request.head.sha }} |
33 | | - - name: Set up Python ${{ matrix.python-version }} |
34 | | - uses: actions/setup-python@v6 |
35 | | - with: |
36 | | - python-version: ${{ matrix.python-version }} |
37 | | - - name: Install dependencies |
38 | | - run: | |
39 | | - python -m pip install --upgrade pip |
40 | | - pip install pytest tox tox-gh-actions |
41 | | - - shell: bash |
42 | | - id: write-license |
43 | | - env: |
44 | | - LICENSE: ${{ secrets.LICENSE }} |
45 | | - run: | |
46 | | - echo "$LICENSE" > $PWD/gurobi.lic |
47 | | - echo "grb_license_file=$PWD/gurobi.lic" >> $GITHUB_OUTPUT |
48 | | - - name: Test with tox |
49 | | - run: | |
50 | | - tox |
51 | | - env: |
52 | | - GRB_LICENSE_FILE: ${{ steps.write-license.outputs.grb_license_file }} |
53 | | - GUROBI_VERSION: ${{ matrix.gurobi-version }} |
54 | | - - name: Run examples with Gurobi 11 |
55 | | - if: ${{ (matrix.gurobi-version == 'gurobi11') && (matrix.python-version == '3.12') }} |
56 | | - env: |
57 | | - GRB_LICENSE_FILE: ${{ steps.write-license.outputs.grb_license_file }} |
58 | | - GUROBI_VERSION: ${{ matrix.gurobi-version }} |
59 | | - run: | |
60 | | - python_version_no_dot=$(echo "${{ matrix.python-version }}" | tr -d '.') |
61 | | - tox -e py${python_version_no_dot}-examples-${{matrix.gurobi-version}} |
| 67 | + - uses: actions/checkout@v5 |
| 68 | + with: |
| 69 | + ref: ${{ github.event.pull_request.head.sha }} |
| 70 | + - name: Setup Python |
| 71 | + uses: ./.github/actions/setup-python-and-install |
| 72 | + with: |
| 73 | + python-version: ${{ matrix.python-version }} |
| 74 | + - name: Setup uv |
| 75 | + uses: astral-sh/setup-uv@v3 |
| 76 | + - id: write-license |
| 77 | + name: Write license |
| 78 | + uses: ./.github/actions/write-license |
| 79 | + with: |
| 80 | + license: ${{ secrets.LICENSE }} |
| 81 | + - name: Run examples (uv) |
| 82 | + env: |
| 83 | + GRB_LICENSE_FILE: ${{ steps.write-license.outputs.grb_license_file }} |
| 84 | + GUROBI_VERSION: ${{ matrix.gurobi-version }} |
| 85 | + run: | |
| 86 | + python_version_no_dot=$(echo "${{ matrix.python-version }}" | tr -d '.') |
| 87 | + uvx tox -e py${python_version_no_dot}-examples-${{ matrix.gurobi-version }} |
0 commit comments