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,13 @@ 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.xml
105
96
106
97
- name : Report failure if git reports dirty status
107
98
run : |
@@ -112,26 +103,68 @@ jobs:
112
103
exit 99
113
104
fi
114
105
# https://github.com/actions/toolkit/issues/193
115
- check : # This job does nothing and is only used for the branch protection
106
+
107
+ check :
116
108
if : always()
117
109
permissions :
118
110
pull-requests : write # allow codenotify to comment on pull-request
111
+ id-token : write
112
+ checks : read
119
113
120
114
needs :
121
115
- build
122
-
123
116
runs-on : ubuntu-latest
124
117
125
118
steps :
119
+ - name : Set up Python
120
+ uses : actions/setup-python@v5
121
+ with :
122
+ python-version : " 3.12"
123
+
124
+ - run : pip3 install 'coverage>=7.5.1'
125
+
126
+ - name : Merge logs into a single archive
127
+ uses : actions/upload-artifact/merge@v4
128
+ with :
129
+ name : logs.zip
130
+ pattern : logs-*.zip
131
+ separate-directories : true
132
+
133
+ - name : Download artifacts
134
+ uses : actions/download-artifact@v4
135
+ with :
136
+ name : logs.zip
137
+
138
+ - name : Check for expected number of coverage.xml reports
139
+ run : |
140
+ JOBS_PRODUCING_COVERAGE=5
141
+ if [ "$(find . -name coverage.xml | wc -l | bc)" -ne "${JOBS_PRODUCING_COVERAGE}" ]; then
142
+ echo "::error::Number of coverage.xml files was not the expected one (${JOBS_PRODUCING_COVERAGE}): $(find . -name coverage.xml |xargs echo)"
143
+ exit 1
144
+ fi
145
+
146
+ - name : Upload coverage data
147
+ uses : codecov/codecov-action@v4
148
+ with :
149
+ name : ${{ matrix.passed_name }}
150
+ fail_ci_if_error : true
151
+ use_oidc : true
152
+
153
+ - name : Check codecov.io status
154
+ if : github.event_name == 'pull_request'
155
+ uses : coactions/codecov-status@main
156
+
126
157
- name : Decide whether the needed jobs succeeded or failed
127
158
uses : re-actors/alls-green@release/v1
128
159
with :
129
160
jobs : ${{ toJSON(needs) }}
130
161
131
- - name : Check out src from Git
132
- uses : actions/checkout@v4
162
+ - name : Delete Merged Artifacts
163
+ uses : actions/upload-artifact/merge@v4
164
+ with :
165
+ delete-merged : true
133
166
134
- - name : Notify repository owners about lint change affecting them
167
+ - name : Notify repository owners about changes affecting them
135
168
uses : sourcegraph/codenotify@v0.6.4
136
169
env :
137
170
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments