-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 1.69 KB
/
nightly_regression_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
45
46
47
48
49
50
51
52
53
54
55
56
name: Nightly Regression Tests
on:
schedule:
- cron: '0 3 * * *' # Runs every day at 3:00 AM UTC
workflow_dispatch: # Allows manual trigger
jobs:
nightly-tests:
runs-on: ubuntu-latest
steps:
# Step 1: Check out the repository
- name: Check out the repository
uses: actions/checkout@v3
# Step 2: Set up Python
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
# Step 3: Cache pip dependencies
- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
# Step 4: Install dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
# Step 5: Run regression tests with pytest and generate reports
- name: Run regression tests
run: |
pytest --disable-warnings --maxfail=5 --junitxml=results.xml --tb=short
continue-on-error: true # Ensures workflow proceeds to the next steps even if tests fail
# Step 6: Upload test results as artifacts
- name: Upload Test Results
if: always() # Ensures this step runs even if tests fail
uses: actions/upload-artifact@v3
with:
name: test-results
path: results.xml
# Step 7: Display summary message on failure
- name: Display Test Summary
if: failure()
run: |
echo "Nightly regression tests completed with issues. Review the test-results artifact for details."