|
58 | 58 | COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
|
59 | 59 | run: |
|
60 | 60 | cd src/ci/citool
|
61 |
| - cargo test |
62 |
| - cargo run calculate-job-matrix >> $GITHUB_OUTPUT |
| 61 | + CARGO_INCREMENTAL=0 cargo test |
| 62 | + CARGO_INCREMENTAL=0 cargo run calculate-job-matrix >> $GITHUB_OUTPUT |
63 | 63 | id: jobs
|
64 | 64 | job:
|
65 | 65 | name: ${{ matrix.full_name }}
|
|
68 | 68 | timeout-minutes: 360
|
69 | 69 | env:
|
70 | 70 | CI_JOB_NAME: ${{ matrix.name }}
|
| 71 | + CI_JOB_DOC_URL: ${{ matrix.doc_url }} |
| 72 | + GITHUB_WORKFLOW_RUN_ID: ${{ github.run_id }} |
| 73 | + GITHUB_REPOSITORY: ${{ github.repository }} |
71 | 74 | CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
|
72 | 75 | # commit of PR sha or commit sha. `GITHUB_SHA` is not accurate for PRs.
|
73 | 76 | HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
|
@@ -182,9 +185,28 @@ jobs:
|
182 | 185 | - name: show the current environment
|
183 | 186 | run: src/ci/scripts/dump-environment.sh
|
184 | 187 |
|
| 188 | + # Pre-build citool before the following step uninstalls rustup |
| 189 | + # Build it into the build directory, to avoid modifying sources |
| 190 | + - name: build citool |
| 191 | + run: | |
| 192 | + cd src/ci/citool |
| 193 | + CARGO_INCREMENTAL=0 CARGO_TARGET_DIR=../../../build/citool cargo build |
| 194 | +
|
185 | 195 | - name: run the build
|
186 |
| - # Redirect stderr to stdout to avoid reordering the two streams in the GHA logs. |
187 |
| - run: src/ci/scripts/run-build-from-ci.sh 2>&1 |
| 196 | + run: | |
| 197 | + set +e |
| 198 | + # Redirect stderr to stdout to avoid reordering the two streams in the GHA logs. |
| 199 | + src/ci/scripts/run-build-from-ci.sh 2>&1 |
| 200 | + STATUS=$? |
| 201 | + set -e |
| 202 | +
|
| 203 | + if [[ "$STATUS" -ne 0 && -n "$CI_JOB_DOC_URL" ]]; then |
| 204 | + echo "****************************************************************************" |
| 205 | + echo "To find more information about this job, visit the following URL:" |
| 206 | + echo "$CI_JOB_DOC_URL" |
| 207 | + echo "****************************************************************************" |
| 208 | + fi |
| 209 | + exit ${STATUS} |
188 | 210 | env:
|
189 | 211 | AWS_ACCESS_KEY_ID: ${{ env.CACHES_AWS_ACCESS_KEY_ID }}
|
190 | 212 | AWS_SECRET_ACCESS_KEY: ${{ secrets[format('AWS_SECRET_ACCESS_KEY_{0}', env.CACHES_AWS_ACCESS_KEY_ID)] }}
|
@@ -218,16 +240,37 @@ jobs:
|
218 | 240 | # erroring about invalid credentials instead.
|
219 | 241 | if: github.event_name == 'push' || env.DEPLOY == '1' || env.DEPLOY_ALT == '1'
|
220 | 242 |
|
| 243 | + - name: postprocess metrics into the summary |
| 244 | + # This step is not critical, and if some I/O problem happens, we don't want |
| 245 | + # to cancel the build. |
| 246 | + continue-on-error: true |
| 247 | + run: | |
| 248 | + if [ -f build/metrics.json ]; then |
| 249 | + METRICS=build/metrics.json |
| 250 | + elif [ -f obj/build/metrics.json ]; then |
| 251 | + METRICS=obj/build/metrics.json |
| 252 | + else |
| 253 | + echo "No metrics.json found" |
| 254 | + exit 0 |
| 255 | + fi |
| 256 | +
|
| 257 | + # Get closest bors merge commit |
| 258 | + PARENT_COMMIT=`git rev-list --author='bors <[email protected]>' -n1 --first-parent HEAD^1` |
| 259 | +
|
| 260 | + ./build/citool/debug/citool postprocess-metrics \ |
| 261 | + --job-name ${CI_JOB_NAME} \ |
| 262 | + --parent ${PARENT_COMMIT} \ |
| 263 | + ${METRICS} >> ${GITHUB_STEP_SUMMARY} |
| 264 | +
|
221 | 265 | - name: upload job metrics to DataDog
|
| 266 | + # This step is not critical, and if some I/O problem happens, we don't want |
| 267 | + # to cancel the build. |
| 268 | + continue-on-error: true |
222 | 269 | if: needs.calculate_matrix.outputs.run_type != 'pr'
|
223 | 270 | env:
|
224 |
| - DATADOG_SITE: datadoghq.com |
225 | 271 | DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }}
|
226 | 272 | DD_GITHUB_JOB_NAME: ${{ matrix.full_name }}
|
227 |
| - run: | |
228 |
| - cd src/ci |
229 |
| - npm ci |
230 |
| - python3 scripts/upload-build-metrics.py ../../build/cpu-usage.csv |
| 273 | + run: ./build/citool/debug/citool upload-build-metrics build/cpu-usage.csv |
231 | 274 |
|
232 | 275 | # This job isused to tell bors the final status of the build, as there is no practical way to detect
|
233 | 276 | # when a workflow is successful listening to webhooks only in our current bors implementation (homu).
|
|
0 commit comments