66 - 600-feature-improve-github-testing
77
88 pull_request :
9+
10+ branches :
11+ - dev
912
1013jobs :
1114 fast-tests :
@@ -19,21 +22,68 @@ jobs:
1922 uses : actions/setup-python@v4
2023 with :
2124 python-version : ' 3.11'
22-
25+
2326 - name : Install dependencies
24- run :
25- pip install -r requirements.txt
27+ run : |
28+ python -m pip install --upgrade pip
29+ pip install -r requirements.txt
30+ pip install -r rtd_requirements.txt
31+ pip install -e .
32+ pip install pytest-html
2633
27- - name : Install dependencies
28- run : pip install -r rtd_requirements.txt
34+ - name : Run fast tests
35+ run : |
36+ python -m pytest -m "fast" -vv \
37+ --durations=20 \
38+ --junitxml=fast-report.xml \
39+ --html=fast-report.html \
40+ --self-contained-html \
41+ > fast-output.txt 2>&1
42+
43+ - name : Upload fast test reports
44+ uses : actions/upload-artifact@v4
45+ with :
46+ name : fast-test-reports
47+ path : |
48+ fast-report.xml
49+ fast-report.html
50+ fast-output.txt
51+
52+ full-tests :
53+ if : github.event_name == 'pull_request'
54+ runs-on : ubuntu-latest
2955
30- - name : Install project
31- run : pip install -e .
56+ steps :
57+ - name : Checkout code
58+ uses : actions/checkout@v4
59+
60+ - name : Set up Python
61+ uses : actions/setup-python@v5
62+ with :
63+ python-version : " 3.11"
64+
65+ - name : Install dependencies
66+ run : |
67+ python -m pip install --upgrade pip
68+ pip install -r requirements.txt
69+ pip install -r rtd_requirements.txt
70+ pip install -e .
71+ pip install pytest-html
3272
33- - name : Run fast tests on push
34- if : github.event_name == 'push'
35- run : pytest -m "fast"
73+ - name : Run full test suite
74+ run : |
75+ python -m pytest -vv \
76+ --durations=20 \
77+ --junitxml=full-report.xml \
78+ --html=full-report.html \
79+ --self-contained-html \
80+ > full-output.txt 2>&1
3681
37- - name : Run all tests on PR
38- if : github.event_name == 'pull_request'
39- run : pytest
82+ - name : Upload full test reports
83+ uses : actions/upload-artifact@v4
84+ with :
85+ name : full-test-reports
86+ path : |
87+ full-report.xml
88+ full-report.html
89+ full-output.txt
0 commit comments