|
7 | 7 | jobs:
|
8 | 8 | test:
|
9 | 9 | runs-on: ubuntu-latest
|
| 10 | + name: Python ${{ matrix.python-version }} |
| 11 | + |
10 | 12 | strategy:
|
11 | 13 | matrix:
|
12 |
| - python-version: [3.7, 3.8, 3.9, "3.10"] |
| 14 | + python-version: |
| 15 | + - '3.7' |
| 16 | + - '3.8' |
| 17 | + - '3.9' |
| 18 | + - '3.10' |
| 19 | + - '3.11' |
| 20 | + |
13 | 21 | steps:
|
14 |
| - - uses: actions/checkout@v2 |
15 |
| - - name: Set up Python ${{ matrix.python-version }} |
16 |
| - uses: actions/setup-python@v2 |
17 |
| - with: |
18 |
| - python-version: ${{ matrix.python-version }} |
19 |
| - - uses: actions/cache@v2 |
20 |
| - name: Configure pip caching |
21 |
| - with: |
22 |
| - path: ~/.cache/pip |
23 |
| - key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} |
24 |
| - restore-keys: | |
25 |
| - ${{ runner.os }}-pip- |
26 |
| - - name: Install dependencies |
27 |
| - run: | |
28 |
| - pip install -e '.[test]' |
29 |
| - - name: Run tests |
30 |
| - run: | |
31 |
| - pytest |
| 22 | + - uses: actions/checkout@v3 |
| 23 | + |
| 24 | + - uses: actions/setup-python@v4 |
| 25 | + with: |
| 26 | + python-version: ${{ matrix.python-version }} |
| 27 | + |
| 28 | + - uses: actions/cache@v3 |
| 29 | + with: |
| 30 | + path: ~/.cache/pip |
| 31 | + key: ${{ runner.os }}-pip-${{ hashFiles('requirements/*.txt') }} |
| 32 | + restore-keys: | |
| 33 | + ${{ runner.os }}-pip- |
| 34 | + - name: Upgrade packaging tools |
| 35 | + run: python -m pip install --upgrade pip setuptools virtualenv wheel |
| 36 | + |
| 37 | + - name: Install dependencies |
| 38 | + run: python -m pip install --upgrade tox |
| 39 | + |
| 40 | + - name: Run tox targets for ${{ matrix.python-version }} |
| 41 | + run: | |
| 42 | + ENV_PREFIX=$(tr -C -d "0-9" <<< "${{ matrix.python-version }}") |
| 43 | + TOXENV=$(tox --listenvs | grep "^py$ENV_PREFIX" | tr '\n' ',') tox |
| 44 | + - name: Run lint |
| 45 | + if: ${{ matrix.python-version == '3.9' }} |
| 46 | + run: | |
| 47 | + tox -e lint |
| 48 | +
|
32 | 49 | deploy:
|
33 | 50 | runs-on: ubuntu-latest
|
34 | 51 | needs: [test]
|
35 | 52 | steps:
|
36 |
| - - uses: actions/checkout@v2 |
| 53 | + - uses: actions/checkout@v3 |
37 | 54 | - name: Set up Python
|
38 |
| - uses: actions/setup-python@v2 |
| 55 | + uses: actions/setup-python@v4 |
39 | 56 | with:
|
40 | 57 | python-version: "3.10"
|
41 |
| - - uses: actions/cache@v2 |
42 |
| - name: Configure pip caching |
43 |
| - with: |
44 |
| - path: ~/.cache/pip |
45 |
| - key: ${{ runner.os }}-publish-pip-${{ hashFiles('**/setup.py') }} |
46 |
| - restore-keys: | |
47 |
| - ${{ runner.os }}-publish-pip- |
48 | 58 | - name: Install dependencies
|
49 | 59 | run: |
|
50 | 60 | pip install setuptools wheel twine
|
|
0 commit comments