-
Notifications
You must be signed in to change notification settings - Fork 18
48 lines (45 loc) · 1.17 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
name: test
on:
# Pull request trigger works only for PRs into main branch
pull_request:
branches:
- master
push:
# Push only works for tags.
# Will be executed on push or successful merge into main.
tags:
- "v*"
workflow_dispatch:
jobs:
tests:
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- uses: ./.github/actions/setup
- name: Tests
run: |
# Run tests
poetry run pytest
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: "3.9"
- uses: ./.github/actions/setup
- name: Coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
# Run tests
poetry run pytest --cov --cov-report=xml
# Send results to codecov
bash <(curl -s https://codecov.io/bash)