|
4 | 4 | branches: [ main ] |
5 | 5 | pull_request: |
6 | 6 |
|
7 | | -env: |
8 | | - POETRY_VERSION: 1.1.11 |
9 | | - CACHE: 0 |
10 | | - |
11 | 7 | jobs: |
12 | 8 | test: |
13 | 9 | name: Tests |
14 | 10 | runs-on: ubuntu-latest |
15 | 11 | strategy: |
16 | 12 | matrix: |
17 | | - python-version: [3.7, 3.8, 3.9] |
| 13 | + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] |
18 | 14 |
|
19 | 15 | steps: |
20 | | - - uses: actions/checkout@v2 |
21 | | - - name: Set up Python ${{ matrix.python-version }} |
22 | | - uses: actions/setup-python@v2 |
23 | | - with: |
24 | | - python-version: ${{ matrix.python-version }} |
25 | | - - name: Cache poetry installation |
26 | | - id: cache-poetry |
27 | | - uses: actions/cache@v2 |
28 | | - with: |
29 | | - path: ~/.local |
30 | | - key: poetry-${{ runner.os }}-${{ matrix.python-version }}-${{ env.POETRY_VERSION }}-${{ hashFiles('.github/workflows/tests.yml') }} |
31 | | - - name: Install poetry |
32 | | - if: steps.cache-poetry.outputs.cache-hit != 'true' |
33 | | - run: | |
34 | | - curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - --version=${{ env.POETRY_VERSION }} |
35 | | - - name: Setup poetry environment |
36 | | - id: setup-poetry-env |
37 | | - run: | |
38 | | - poetry env use $(which python) |
39 | | - echo "::set-output name=poetry-env::$(poetry env info --path)" |
40 | | - - name: Cache poetry virtual environment |
41 | | - id: cache-poetry-venv |
42 | | - uses: actions/cache@v2 |
43 | | - with: |
44 | | - path: ${{ steps.setup-poetry-env.outputs.poetry-env }} |
45 | | - key: poetry-env-${{ runner.os }}-${{ matrix.python-version }}-${{ env.POETRY_VERSION }}-${{ hashFiles('poetry.lock') }}-${{ hashFiles('.github/workflows/tests.yml') }} |
46 | | - - name: Install dependencies |
47 | | - if: steps.cache-poetry-venv.outputs.cache-hit != 'true' |
48 | | - run: | |
49 | | - poetry install |
50 | | - - name: Run unit tests with pytest |
51 | | - run: | |
52 | | - poetry run pytest ./tests |
| 16 | + - uses: actions/checkout@v3 |
| 17 | + - name: Install poetry |
| 18 | + run: pipx install poetry |
| 19 | + - name: Setup Python |
| 20 | + id: setup |
| 21 | + uses: actions/setup-python@v4 |
| 22 | + with: |
| 23 | + python-version: ${{ matrix.python-version }} |
| 24 | + cache: 'poetry' |
| 25 | + - name: Install dependencies |
| 26 | + if: steps.setup.outputs.cache-hit != 'true' |
| 27 | + run: poetry install |
| 28 | + - name: Run unit tests with pytest |
| 29 | + run: | |
| 30 | + poetry run pytest ./tests |
53 | 31 |
|
54 | 32 | int: |
55 | 33 | name: Integration Tests |
56 | 34 | runs-on: ubuntu-latest |
57 | 35 | steps: |
58 | | - - uses: actions/checkout@v2 |
| 36 | + - uses: actions/checkout@v3 |
59 | 37 | - name: Run integration tests |
60 | 38 | run: | |
61 | 39 | docker-compose -f ./int/docker-compose.yml run tests |
|
0 commit comments