-
Notifications
You must be signed in to change notification settings - Fork 3
56 lines (46 loc) · 1.23 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
56
name: Tests
on:
workflow_dispatch: {}
workflow_call: {}
push: {}
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
# was unable to biuld with: 3.7, 3.8, or 3.9
python-version: ["3.10", "3.11"]
steps:
# checkout code
- name: Checkout Code
uses: actions/checkout@v3
# install python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
# install the project
- name: Install dependencies
run: |
pip install .[build]
pip install .[test]
pip install .
# do linting
- name: Lint with ruff
run: |
# stop the build if there are Python syntax errors or undefined names
# ruff --format=github --select=E9,F63,F7,F82 --target-version=py37 .
ruff ./src
# run the tests
- name: Test with pytest
run: |
pytest src --junit-xml=test-results.xml
- name: Surface failing tests
if: always()
uses: pmeier/pytest-results-action@main
with:
path: test-results.xml
summary: true
display-options: fEX
fail-on-empty: true