-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (40 loc) · 1.12 KB
/
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
# Note: add all job names to the deploy-status.needs.
name: Tests
on:
workflow_dispatch:
pull_request:
branches:
- main
jobs:
test_programs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: 3.13
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[tests]
- name: Test pytest
run: |
pytest -n auto -vv --junitxml=./run-test-results.xml
- name: Show tests results
if: always()
uses: pmeier/pytest-results-action@main
with:
path: ./*-test-results.xml
# This allows us to have a branch protection rule this entire workflow
deploy-status:
runs-on: ubuntu-latest
needs: [ test_programs ]
if: always()
steps:
- name: Successful deploy
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Failing deploy
if: ${{ contains(needs.*.result, 'failure') }}
run: exit 1