-
Notifications
You must be signed in to change notification settings - Fork 30
45 lines (40 loc) · 1.15 KB
/
run-tests.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
name: run-tests
on:
pull_request:
push:
branches: [master, dev]
jobs:
run-tests:
strategy:
matrix:
python: ["3.9", "3.10", "3.11"]
os: [ubuntu-latest, macos-13, windows-latest]
runs-on: ${{ matrix.os }}
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install poetry
run: python -m pip install poetry
- name: Cache the virtualenv
id: cache-venv
uses: actions/cache@v4
with:
path: ./.venv
key: ${{ runner.os }}-${{ matrix.python }}-venv-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cache-venv.outputs.cache-hit != 'true'
run: python -m poetry install
- name: Run tests and Generate coverage
run: |
poetry run pytest --cov --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
env_vars: OS,PYTHON