File tree 1 file changed +8
-13
lines changed
1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change 1
- name : Tests
1
+ name : Python Tests
2
2
3
- # Trigger the workflow on pushes and pull requests to the 'master' branch
4
3
on :
5
4
push :
6
5
branches :
9
8
branches :
10
9
- master
11
10
12
- # Define the jobs
13
11
jobs :
14
12
test :
15
- # Run the job on the latest Ubuntu environment
16
13
runs-on : ubuntu-latest
17
14
18
- # Set up Python and install dependencies
19
15
steps :
20
- # Check out the code from the repository
16
+ # Use the latest version of actions
21
17
- name : Check out code
22
- uses : actions/checkout@v3
18
+ uses : actions/checkout@v4
23
19
24
- # Set up Python environment
25
20
- name : Set up Python
26
- uses : actions/setup-python@v2
21
+ uses : actions/setup-python@v4
27
22
with :
28
23
python-version : " 3.x" # Specify the version you want to use (e.g., 3.8, 3.9)
29
24
@@ -37,12 +32,12 @@ jobs:
37
32
- name : Run pytest
38
33
run : |
39
34
pip install pytest # Install pytest if not already in requirements
40
- pytest ./test # Specify the folder where the tests are located
35
+ pytest ./test --junitxml=test-results.xml # Generate test results as XML
41
36
42
- # Optionally, upload test results if you want to see them in the Actions tab
37
+ # Upload test results
43
38
- name : Upload test results
44
39
if : always()
45
- uses : actions/upload-artifact@v3
40
+ uses : actions/upload-artifact@v4
46
41
with :
47
42
name : test-results
48
- path : ./ test-results.xml
43
+ path : test-results.xml # Upload the test results XML file
You can’t perform that action at this time.
0 commit comments