57
57
uses : actions/cache@v2
58
58
with :
59
59
path : ~/conda_pkgs_dir
60
- key :
61
- ${{ runner.os }}-conda-py${{ matrix.python-version }}-${{
60
+ key : ${{ runner.os }}-conda-py${{ matrix.python-version }}-${{
62
61
hashFiles('ci/requirements/**.yml') }}
63
62
- uses : conda-incubator/setup-miniconda@v2
64
63
with :
@@ -87,10 +86,17 @@ jobs:
87
86
run : |
88
87
python -c "import xarray"
89
88
- name : Run tests
90
- run : |
91
- python -m pytest -n 4 \
92
- --cov=xarray \
93
- --cov-report=xml
89
+ run : python -m pytest -n 4
90
+ --cov=xarray
91
+ --cov-report=xml
92
+ --junitxml=test-results/${{ runner.os }}-${{ matrix.python-version }}.xml
93
+
94
+ - name : Upload test results
95
+ if : always()
96
+ uses : actions/upload-artifact@v2
97
+ with :
98
+ name : Test results for ${{ runner.os }}-${{ matrix.python-version }}
99
+ path : test-results/${{ runner.os }}-${{ matrix.python-version }}.xml
94
100
95
101
- name : Upload code coverage to Codecov
96
102
uses : codecov/codecov-action@v1
@@ -100,3 +106,20 @@ jobs:
100
106
env_vars : RUNNER_OS,PYTHON_VERSION
101
107
name : codecov-umbrella
102
108
fail_ci_if_error : false
109
+
110
+ publish-test-results :
111
+ needs : test
112
+ runs-on : ubuntu-latest
113
+ # the build-and-test job might be skipped, we don't need to run this job then
114
+ if : success() || failure()
115
+
116
+ steps :
117
+ - name : Download Artifacts
118
+ uses : actions/download-artifact@v2
119
+ with :
120
+ path : test-results
121
+
122
+ - name : Publish Unit Test Results
123
+ uses : EnricoMi/publish-unit-test-result-action@v1
124
+ with :
125
+ files : test-results/*.xml
0 commit comments