94
94
name : " Combine coverage data"
95
95
needs : coverage
96
96
runs-on : ubuntu-latest
97
+ outputs :
98
+ total : ${{ steps.total.outputs.total }}
99
+ env :
100
+ COVERAGE_RCFILE : " metacov.ini"
97
101
98
102
steps :
99
103
- name : " Check out the repo"
@@ -102,7 +106,7 @@ jobs:
102
106
- name : " Set up Python"
103
107
uses : " actions/setup-python@v4"
104
108
with :
105
- python-version : " 3.8 "
109
+ python-version : " 3.7 " # Minimum of PYVERSIONS
106
110
cache : pip
107
111
cache-dependency-path : ' requirements/*.pip'
108
112
@@ -122,24 +126,21 @@ jobs:
122
126
- name : " Combine and report"
123
127
id : combine
124
128
env :
125
- COVERAGE_RCFILE : " metacov.ini"
126
129
COVERAGE_CONTEXT : " yes"
127
130
run : |
128
131
set -xe
129
- python -m igor combine_html
130
- python -m coverage json
132
+ python igor.py combine_html
131
133
132
134
- name : " Upload HTML report"
133
135
uses : actions/upload-artifact@v3
134
136
with :
135
137
name : html_report
136
138
path : htmlcov
137
139
138
- - name : " Upload JSON report"
139
- uses : actions/upload-artifact@v3
140
- with :
141
- name : json_report
142
- path : coverage.json
140
+ - name : " Get total"
141
+ id : total
142
+ run : |
143
+ echo "total=$(python -m coverage report --format=total)" >> $GITHUB_OUTPUT
143
144
144
145
publish :
145
146
name : " Publish coverage report"
@@ -158,21 +159,15 @@ jobs:
158
159
git config user.email [email protected]
159
160
git checkout main
160
161
161
- - name : " Download coverage JSON report"
162
- uses : actions/download-artifact@v3
163
- with :
164
- name : json_report
165
-
166
162
- name : " Compute info for later steps"
167
163
id : info
168
164
run : |
169
165
set -xe
170
- export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
171
166
export SHA10=$(echo ${{ github.sha }} | cut -c 1-10)
172
167
export SLUG=$(date +'%Y%m%d')_$SHA10
173
168
export REPORT_DIR=reports/$SLUG/htmlcov
174
169
export REF="${{ github.ref }}"
175
- echo "total=$TOTAL " >> $GITHUB_ENV
170
+ echo "total=${{ needs.combine.outputs.total }} " >> $GITHUB_ENV
176
171
echo "sha10=$SHA10" >> $GITHUB_ENV
177
172
echo "slug=$SLUG" >> $GITHUB_ENV
178
173
echo "report_dir=$REPORT_DIR" >> $GITHUB_ENV
0 commit comments