|
3 | 3 | branches: [main]
|
4 | 4 | pull_request:
|
5 | 5 | name: ci
|
| 6 | +env: |
| 7 | + # Bump this to invalidate all caches |
| 8 | + cache-version: 1 |
| 9 | + |
6 | 10 | jobs:
|
7 | 11 | test:
|
8 | 12 | runs-on: ubuntu-latest
|
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + py: |
| 16 | + - {version: "3.7", tox: "37"} |
| 17 | + - {version: "3.8", tox: "38"} |
| 18 | + - {version: "3.9", tox: "39"} |
| 19 | + - {version: "3.10", tox: "310"} |
| 20 | + env: |
| 21 | + run-matrix-combo: ${{ matrix.py.version }} |
| 22 | + |
| 23 | + name: Test ${{ matrix.py.version }} |
9 | 24 | steps:
|
10 | 25 | - uses: actions/checkout@v3
|
11 |
| - - run: echo "hello world" |
| 26 | + - name: Set up Python ${{ matrix.py.version }} |
| 27 | + uses: actions/setup-python@v4 |
| 28 | + with: |
| 29 | + python-version: ${{ matrix.py.version }} |
| 30 | + - uses: actions/cache@v3 |
| 31 | + with: |
| 32 | + path: ~/.cache/pip |
| 33 | + key: ${{ env.cache-version }}-${{ env.run-matrix-combo }}-pip-${{ hashFiles('tox.ini', 'dev-constraints.txt') }} |
| 34 | + restore-keys: | |
| 35 | + ${{ env.cache-version }}-${{ env.run-matrix-combo }}-pip |
| 36 | + - name: Install tox |
| 37 | + # Pin tox 3 because of https://github.com/rpkilby/tox-factor/issues/18 |
| 38 | + run: pip install -U tox==3.27.1 tox-factor |
| 39 | + - name: Run tox test factors for python ${{ matrix.py.version }} |
| 40 | + run: > |
| 41 | + tox |
| 42 | + --skip-missing-interpreters=true |
| 43 | + -f py${{ matrix.py.tox }}-ci |
| 44 | +
|
| 45 | + lint: |
| 46 | + runs-on: ubuntu-latest |
| 47 | + strategy: |
| 48 | + matrix: |
| 49 | + target: [lint-ci, docs-ci, mypy-ci] |
| 50 | + py: |
| 51 | + - {version: "3.10"} |
| 52 | + |
| 53 | + env: |
| 54 | + run-matrix-combo: ${{ matrix.py.version }}-${{ matrix.target }} |
| 55 | + |
| 56 | + name: ${{ matrix.target }} |
| 57 | + steps: |
| 58 | + - uses: actions/checkout@v3 |
| 59 | + - name: Set up Python ${{ matrix.py.version }} |
| 60 | + uses: actions/setup-python@v4 |
| 61 | + with: |
| 62 | + python-version: ${{ matrix.py.version }} |
| 63 | + - uses: actions/cache@v3 |
| 64 | + with: |
| 65 | + path: ~/.cache/pip |
| 66 | + key: ${{ env.cache-version }}-${{ env.run-matrix-combo }}-pip-${{ hashFiles('tox.ini', 'dev-constraints.txt') }} |
| 67 | + restore-keys: | |
| 68 | + ${{ env.cache-version }}-${{ env.run-matrix-combo }}-pip |
| 69 | + - name: Install tox |
| 70 | + # Pin tox 3 because of https://github.com/rpkilby/tox-factor/issues/18 |
| 71 | + run: pip install -U tox==3.27.1 tox-factor |
| 72 | + - name: Run tox factors ${{ matrix.target }} |
| 73 | + run: tox -f ${{ matrix.target }} |
0 commit comments