Skip to content

Commit e01c8be

Browse files
committed
updated test.yml file
1 parent 0b6bf7c commit e01c8be

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

.github/workflows/test.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: Run Tests
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
410

511
jobs:
612
test:
@@ -18,8 +24,18 @@ jobs:
1824
- name: Install dependencies
1925
run: |
2026
python -m pip install --upgrade pip
21-
pip install pytest
27+
pip install -r requirements.txt # Install dependencies from requirements.txt
28+
pip install pytest # Ensure pytest is installed
2229
2330
- name: Run tests
24-
run: pytest
25-
31+
run: |
32+
pytest --maxfail=1 --disable-warnings -q # Stop after 1 failed test, disable warnings, and show results quietly
33+
34+
- name: Upload test results (if tests fail)
35+
if: failure() # This step will only run if tests fail
36+
uses: actions/upload-artifact@v2
37+
with:
38+
name: test-results
39+
path: tests/test-results.xml # Make sure you have pytest XML output configured if you want this
40+
41+

0 commit comments

Comments
 (0)