-
Notifications
You must be signed in to change notification settings - Fork 4
92 lines (83 loc) · 2.98 KB
/
python-tests.yaml
File metadata and controls
92 lines (83 loc) · 2.98 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Python Tests
on:
schedule:
- cron: 0 */6 * * *
pull_request: {}
jobs:
python_test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
variant: linux
- os: macos-latest
variant: macOS
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run pytest tests
id: pytest_tests
if: ${{ always() }}
run:
pytest python/pytest/** --junitxml=python/results/pytest/pytest_test.xml -o
junit_family=xunit1
continue-on-error: true
- name: Process pytest results
# Run this step even if the test step ahead fails
if: ${{ always() }}
uses: trunk-io/analytics-uploader@main
env:
TRUNK_PUBLIC_API_ADDRESS: ${{ vars.TRUNK_API_ENDPOINT }}
with:
# Path to your test results.
junit-paths: python/results/pytest/pytest_test.xml
# Provide your Trunk organization slug.
org-slug: ${{ vars.ORG_SLUG }}
# Provide your Trunk API token as a GitHub secret.
token: ${{ secrets.TRUNK_TOKEN }}
# Variant to distinguish between OS platforms
variant: ${{ matrix.variant }}
# Pass the test outcome for quarantining support
previous-step-outcome: ${{ steps.pytest_tests.outcome }}
- name: Run robotframework tests
id: robotframework_tests
if: ${{ always() }}
run:
pabot --testlevelsplit --outputdir=python/results/robotframework --xunit=robot_test.xml --output=robot_test.xml
python/robotframework/**
continue-on-error: true
- name: Process robotframework results
# Run this step even if the test step ahead fails
if: ${{ always() }}
uses: trunk-io/analytics-uploader@main
env:
TRUNK_PUBLIC_API_ADDRESS: ${{ vars.TRUNK_API_ENDPOINT }}
with:
# Path to your test results.
junit-paths: python/results/robotframework/robot_test.xml
# Provide your Trunk organization slug.
org-slug: ${{ vars.ORG_SLUG }}
# Provide your Trunk API token as a GitHub secret.
token: ${{ secrets.TRUNK_TOKEN }}
# Variant to distinguish between OS platforms
variant: ${{ matrix.variant }}
# Pass the test outcome for quarantining support
previous-step-outcome: ${{ steps.robotframework_tests.outcome }}
- name: Upload JUnit XML artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: python-junit-results-${{ matrix.variant }}
path: |
python/results/**/*_test.xml
python/**/*_test.xml
retention-days: 7