|
4 | 4 | # Prevent duplicate builds for 'internal' pull requests on existing commits |
5 | 5 | # Credit: https://github.community/t/duplicate-checks-on-push-and-pull-request-simultaneous-event/18012 |
6 | 6 | if: github.event.push || github.event.pull_request.head.repo.full_name != github.repository |
7 | | - runs-on: ubuntu-latest |
8 | 7 | strategy: |
9 | 8 | fail-fast: false |
10 | 9 | matrix: |
11 | | - python: ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11", "pypy-2.7", "pypy-3.8"] |
| 10 | + # 2.7, 3.5, and 3.6 run on Windows via AppVeyor |
| 11 | + python: ["3.7", "3.8", "3.9", "3.10", "3.11"] |
| 12 | + os: [ubuntu-latest, windows-latest] |
| 13 | + deps: [base, optional] |
| 14 | + include: |
| 15 | + - python: "pypy-2.7" |
| 16 | + os: ubuntu-latest |
| 17 | + deps: base |
| 18 | + - python: "pypy-3.8" |
| 19 | + os: ubuntu-latest |
| 20 | + deps: base |
| 21 | + - python: "2.7" |
| 22 | + os: ubuntu-latest |
| 23 | + deps: oldest |
| 24 | + - python: "3.7" |
| 25 | + os: ubuntu-latest |
| 26 | + deps: oldest |
| 27 | + runs-on: ${{ matrix.os }} |
12 | 28 | steps: |
13 | 29 | - uses: actions/checkout@v3 |
14 | 30 | with: |
15 | 31 | submodules: true |
16 | | - - uses: actions/setup-python@v4 |
| 32 | + - if: ${{ matrix.deps == 'base' }} |
| 33 | + uses: actions/setup-python@v4 |
17 | 34 | with: |
18 | 35 | python-version: ${{ matrix.python }} |
19 | 36 | cache: pip |
20 | | - cache-dependency-path: "requirements*.txt" |
| 37 | + cache-dependency-path: | |
| 38 | + requirements.txt |
| 39 | + requirements-test.txt |
| 40 | + - if: ${{ matrix.deps == 'optional' }} |
| 41 | + uses: actions/setup-python@v4 |
| 42 | + with: |
| 43 | + python-version: ${{ matrix.python }} |
| 44 | + cache: pip |
| 45 | + cache-dependency-path: | |
| 46 | + requirements.txt |
| 47 | + requirements-optional.txt |
| 48 | + requirements-test.txt |
| 49 | + - if: ${{ matrix.deps == 'oldest' }} |
| 50 | + uses: actions/setup-python@v4 |
| 51 | + with: |
| 52 | + python-version: ${{ matrix.python }} |
| 53 | + cache: pip |
| 54 | + cache-dependency-path: | |
| 55 | + requirements-oldest.txt |
| 56 | + - if: ${{ matrix.os == 'windows-latest' }} |
| 57 | + name: Determine environment name for Tox (PowerShell) |
| 58 | + run: python toxver.py ${{ matrix.python }} ${{ matrix.deps }} >> $env:GITHUB_ENV |
| 59 | + - if: ${{ matrix.os == 'ubuntu-latest' }} |
| 60 | + name: Determine environment name for Tox (Bash) |
| 61 | + run: python toxver.py ${{ matrix.python }} ${{ matrix.deps }} >> $GITHUB_ENV |
21 | 62 | - run: pip install tox |
22 | | - - run: tox -e py |
| 63 | + - run: tox |
23 | 64 | - if: ${{ always() }} |
24 | 65 | run: python debug-info.py |
0 commit comments