-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (44 loc) · 1.41 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Python 🐍 package 📦 test
on:
pull_request:
branches:
- main
- develop
jobs:
get-python-versions:
runs-on: ubuntu-latest
outputs:
python-matrix: ${{ steps.get-python-versions-action.outputs.latest-python-versions }}
steps:
- uses: snok/latest-python-versions@v1
id: get-python-versions-action
with:
min-version: 3.8
test:
needs: [get-python-versions]
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ${{ fromJson(needs.get-python-versions.outputs.python-matrix) }}
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Load cached Poetry installation
uses: actions/cache@v3
with:
path: ~/.local # the path depends on the OS
key: poetry-0 # increment to reset cache
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Specify Poetry Python version
run: poetry env use ${{ matrix.python-version }}
- name: Install dependencies
run: poetry install --with test --no-interaction
- name: Run tests
run: poetry run pytest --cov
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3