40
40
build :
41
41
name : ${{ matrix.name }}
42
42
runs-on : ${{ matrix.os || 'ubuntu-22.04' }}
43
- permissions :
44
- id-token : write
45
43
needs :
46
44
- prepare
47
45
defaults :
@@ -88,20 +86,14 @@ jobs:
88
86
- name : tox -e ${{ matrix.passed_name }}
89
87
run : python3 -m tox -e ${{ matrix.passed_name }}
90
88
91
- - name : Upload coverage data
92
- if : ${{ startsWith(matrix.passed_name, 'py') }}
93
- uses : codecov/codecov-action@v4
94
- with :
95
- name : ${{ matrix.passed_name }}
96
- fail_ci_if_error : true
97
- verbose : true # optional (default = false)
98
- use_oidc : true # cspell:ignore oidc
99
-
100
- - name : Archive logs
89
+ - name : Archive logs and coverage data
101
90
uses : actions/upload-artifact@v4
102
91
with :
103
92
name : logs-${{ matrix.name }}.zip
104
- path : .tox/**/log/
93
+ path : |
94
+ .tox/**/log/
95
+ .tox/**/.coverage*
96
+ .tox/**/coverage.xml
105
97
106
98
- name : Report failure if git reports dirty status
107
99
run : |
@@ -112,26 +104,75 @@ jobs:
112
104
exit 99
113
105
fi
114
106
# https://github.com/actions/toolkit/issues/193
115
- check : # This job does nothing and is only used for the branch protection
107
+
108
+ check :
116
109
if : always()
117
110
permissions :
118
111
pull-requests : write # allow codenotify to comment on pull-request
112
+ id-token : write
113
+ checks : read
119
114
120
115
needs :
121
116
- build
122
-
123
117
runs-on : ubuntu-latest
124
118
125
119
steps :
120
+ # checkout needed for codecov action which needs codecov.yml file
121
+ - uses : actions/checkout@v4
122
+
123
+ - name : Set up Python # likely needed for coverage
124
+ uses : actions/setup-python@v5
125
+ with :
126
+ python-version : " 3.12"
127
+
128
+ - run : pip3 install 'coverage>=7.5.1'
129
+
130
+ - name : Merge logs into a single archive
131
+ uses : actions/upload-artifact/merge@v4
132
+ with :
133
+ name : logs.zip
134
+ pattern : logs-*.zip
135
+ # artifacts like py312.zip and py312-macos do have overlapping files
136
+ separate-directories : true
137
+
138
+ - name : Download artifacts
139
+ uses : actions/download-artifact@v4
140
+ with :
141
+ name : logs.zip
142
+ path : .
143
+
144
+ - name : Check for expected number of coverage.xml reports
145
+ run : |
146
+ JOBS_PRODUCING_COVERAGE=5
147
+ if [ "$(find . -name coverage.xml | wc -l | bc)" -ne "${JOBS_PRODUCING_COVERAGE}" ]; then
148
+ echo "::error::Number of coverage.xml files was not the expected one (${JOBS_PRODUCING_COVERAGE}): $(find . -name coverage.xml |xargs echo)"
149
+ exit 1
150
+ fi
151
+
152
+ - name : Upload coverage data
153
+ uses : codecov/codecov-action@v4
154
+ with :
155
+ name : ${{ matrix.passed_name }}
156
+ # token: ${{ secrets.CODECOV_TOKEN }}
157
+ # verbose: true # optional (default = false)
158
+ fail_ci_if_error : true
159
+ use_oidc : true # cspell:ignore oidc
160
+
161
+ - name : Check codecov.io status
162
+ if : github.event_name == 'pull_request'
163
+ uses : coactions/codecov-status@main
164
+
126
165
- name : Decide whether the needed jobs succeeded or failed
127
166
uses : re-actors/alls-green@release/v1
128
167
with :
129
168
jobs : ${{ toJSON(needs) }}
130
169
131
- - name : Check out src from Git
132
- uses : actions/checkout@v4
170
+ - name : Delete Merged Artifacts
171
+ uses : actions/upload-artifact/merge@v4
172
+ with :
173
+ delete-merged : true
133
174
134
- - name : Notify repository owners about lint change affecting them
175
+ - name : Notify repository owners about changes affecting them
135
176
uses : sourcegraph/codenotify@v0.6.4
136
177
env :
137
178
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments