|
1 |
| -# Source: https://github.com/marketplace/actions/install-poetry-action |
| 1 | +name: Test |
2 | 2 |
|
3 |
| -name: Test with tox |
4 |
| - |
5 |
| -# Test on push |
6 | 3 | on:
|
7 | 4 | push
|
8 | 5 |
|
9 | 6 | jobs:
|
10 | 7 | test:
|
11 | 8 | runs-on: ubuntu-latest
|
| 9 | + strategy: |
| 10 | + max-parallel: 2 |
| 11 | + matrix: |
| 12 | + python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ] |
12 | 13 | steps:
|
13 |
| - #---------------------------------------------- |
14 |
| - # check-out repo and set-up python |
15 |
| - #---------------------------------------------- |
16 |
| - - name: Check out repository |
17 |
| - uses: actions/checkout@v2 |
18 |
| - - name: Set up python |
19 |
| - id: setup-python |
20 |
| - uses: actions/setup-python@v2 |
| 14 | + - uses: actions/checkout@v3 |
| 15 | + - uses: actions/setup-python@v4 |
21 | 16 | with:
|
22 |
| - python-version: 3.9 |
23 |
| - #---------------------------------------------- |
24 |
| - # ----- install & configure poetry ----- |
25 |
| - #---------------------------------------------- |
26 |
| - - name: Install Poetry |
27 |
| - uses: snok/install-poetry@v1 |
| 17 | + python-version: ${{ matrix.python-version }} |
| 18 | + - uses: snok/install-poetry@v1 |
28 | 19 | with:
|
29 |
| - virtualenvs-create: true |
30 | 20 | virtualenvs-in-project: true
|
31 |
| - installer-parallel: true |
32 |
| - |
33 |
| - #---------------------------------------------- |
34 |
| - # load cached venv if cache exists |
35 |
| - #---------------------------------------------- |
36 |
| - - name: Load cached venv |
37 |
| - id: cached-poetry-dependencies |
38 |
| - uses: actions/cache@v2 |
39 |
| - with: |
40 |
| - path: .venv |
41 |
| - key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} |
42 |
| - #---------------------------------------------- |
43 |
| - # install dependencies if cache does not exist |
44 |
| - #---------------------------------------------- |
45 | 21 | - name: Install dependencies
|
46 |
| - if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' |
47 |
| - run: poetry install --no-interaction --no-root |
48 |
| - #---------------------------------------------- |
49 |
| - # install your root project, if required |
50 |
| - #---------------------------------------------- |
51 |
| - - name: Install library |
52 |
| - run: poetry install --no-interaction |
53 |
| - #---------------------------------------------- |
54 |
| - # run test suite |
55 |
| - #---------------------------------------------- |
56 |
| - - name: Run tests |
57 |
| - run: poetry run tox |
| 22 | + run: | |
| 23 | + pip install --upgrade pip |
| 24 | + pip install tox tox-gh-actions |
| 25 | + poetry install --no-interaction |
| 26 | + - name: Run tox |
| 27 | + run: tox |
0 commit comments