-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (61 loc) · 1.74 KB
/
test.yaml
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: Tests
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
concurrency:
group: tests-${{ github.head_ref || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
taplo-lint:
name: taplo lint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: uncenter/setup-taplo@v1
with:
version: "0.8.1"
- run: taplo fmt --check
unit-tests:
name: unit test ${{ matrix.os }} / ${{ matrix.python-version }}
runs-on: ${{ matrix.image }}
strategy:
matrix:
os: [Ubuntu]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
include:
- os: Ubuntu
image: ubuntu-22.04
fail-fast: false
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
id: setup-python
with:
python-version: ${{ matrix.python-version }}
- name: Set up nox
run: pip install nox
- name: Set up cache
uses: actions/cache@v4
id: cache
with:
path: .nox
key: nox-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('noxfile.py') }}
- name: Run unit test
run: |
nox -s "test-${{ matrix.python-version }}" --no-stop-on-first-error -- coverage.${{ runner.os }}-py${{ matrix.python-version }}.xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Check for clean working tree
run: |
git diff --exit-code --stat HEAD