|
39 | 39 | - run-on-tokio-explicit
|
40 | 40 | - run-on-tokio-implicit
|
41 | 41 | - run-on-perf-event-open-sys2
|
| 42 | + - fails-on-1-64-rustc-rust-fnv |
42 | 43 | if: ${{ success() || failure() }} # Run this job even if a dependency has failed.
|
43 | 44 | steps:
|
44 | 45 | - name: Job outcomes
|
|
60 | 61 | echo "run-on-tokio-explicit: ${{ needs.run-on-tokio-explicit.result }}"
|
61 | 62 | echo "run-on-tokio-implicit: ${{ needs.run-on-tokio-implicit.result }}"
|
62 | 63 | echo "run-on-perf-event-open-sys2: ${{ needs.run-on-perf-event-open-sys2.result }}"
|
| 64 | + echo "fails-on-1-64-rustc-rust-fnv: ${{ needs.fails-on-1-64-rustc-rust-fnv.result }}" |
63 | 65 |
|
64 | 66 | # Fail this required job if any of its dependent jobs have failed.
|
65 | 67 | #
|
@@ -100,6 +102,8 @@ jobs:
|
100 | 102 | run: exit 1
|
101 | 103 | - if: ${{ needs.run-on-perf-event-open-sys2.result != 'success' }}
|
102 | 104 | run: exit 1
|
| 105 | + - if: ${{ needs.fails-on-1-64-rustc-rust-fnv.result != 'success' }} |
| 106 | + run: exit 1 |
103 | 107 |
|
104 | 108 | lint:
|
105 | 109 | name: Check lint and rustfmt
|
@@ -1383,6 +1387,91 @@ jobs:
|
1383 | 1387 | key: ${{ runner.os }}-${{ steps.toolchain.outputs.cachekey }}-${{ hashFiles('semver/**/Cargo.lock') }}-${{ github.job }}-rustdoc
|
1384 | 1388 | path: subject/target/semver-checks/cache
|
1385 | 1389 |
|
| 1390 | + fails-on-1-64-rustc-rust-fnv: |
| 1391 | + # cargo-semver-checks fails if the rustc version is not high enough |
| 1392 | + # because of rustdoc format incompatibilities. This test ensures that |
| 1393 | + # we have a good error message. |
| 1394 | + # https://github.com/obi1kenobi/cargo-semver-checks/issues/444 |
| 1395 | + name: 'Check failure on 1.64' |
| 1396 | + runs-on: ubuntu-latest |
| 1397 | + needs: |
| 1398 | + - build-binary |
| 1399 | + steps: |
| 1400 | + - name: Checkout cargo-semver-checks |
| 1401 | + uses: actions/checkout@v3 |
| 1402 | + with: |
| 1403 | + persist-credentials: false |
| 1404 | + path: 'semver' |
| 1405 | + |
| 1406 | + # rust-fnv is very lightweight and quite stable. |
| 1407 | + - name: Checkout rust-fnv |
| 1408 | + uses: actions/checkout@v3 |
| 1409 | + with: |
| 1410 | + persist-credentials: false |
| 1411 | + repository: "servo/rust-fnv" |
| 1412 | + ref: '94334357754a82f3ffb705dc387bd5f4c921e954' |
| 1413 | + path: 'subject' |
| 1414 | + |
| 1415 | + - name: Install rust |
| 1416 | + id: toolchain |
| 1417 | + |
| 1418 | + |
| 1419 | + - name: Restore binary |
| 1420 | + id: cache-binary |
| 1421 | + uses: actions/cache/restore@v3 |
| 1422 | + with: |
| 1423 | + path: bins/ |
| 1424 | + key: bins-${{ runner.os }}-${{ github.run_id }}-${{ github.run_attempt }} |
| 1425 | + fail-on-cache-miss: true |
| 1426 | + |
| 1427 | + - name: Restore rustdoc |
| 1428 | + id: cache |
| 1429 | + uses: actions/cache/restore@v3 |
| 1430 | + with: |
| 1431 | + key: ${{ runner.os }}-${{ steps.toolchain.outputs.cachekey }}-${{ hashFiles('semver/**/Cargo.lock') }}-${{ github.job }}-rustdoc |
| 1432 | + path: subject/target/semver-checks/cache |
| 1433 | + |
| 1434 | + - name: Restore cargo index and rustdoc target dir |
| 1435 | + uses: Swatinem/rust-cache@v2 |
| 1436 | + with: |
| 1437 | + workspaces: | |
| 1438 | + subject/target/semver-checks/local-fnv-1_0_7/ |
| 1439 | +
|
| 1440 | + - name: Run semver-checks |
| 1441 | + continue-on-error: true |
| 1442 | + id: semver_checks |
| 1443 | + run: | |
| 1444 | + cd semver |
| 1445 | + set -euo pipefail |
| 1446 | + ../bins/cargo-semver-checks semver-checks check-release --manifest-path="../subject/Cargo.toml" 2>&1 | tee output |
| 1447 | + touch unexpectedly_did_not_fail |
| 1448 | +
|
| 1449 | + - name: Check whether it failed |
| 1450 | + if: steps.semver_checks.outcome != 'failure' |
| 1451 | + run: | |
| 1452 | + echo "Error! check-release should have failed because the rustc version is too old (1.64), but it has not." |
| 1453 | + exit 1 |
| 1454 | +
|
| 1455 | + - name: Check output |
| 1456 | + run: | |
| 1457 | + cd semver |
| 1458 | + EXPECTED="$(echo -e "Error: rustc version is not high enough: >=1.65.0 needed, got 1.64.0")" |
| 1459 | + RESULT="$(cat output | grep Error)" |
| 1460 | + diff <(echo "$RESULT") <(echo "$EXPECTED") |
| 1461 | +
|
| 1462 | + - name: Cleanup |
| 1463 | + run: | |
| 1464 | + cd semver |
| 1465 | + rm output |
| 1466 | + rm -f unexpectedly_did_not_fail |
| 1467 | +
|
| 1468 | + - name: Save rustdoc |
| 1469 | + uses: actions/cache/save@v3 |
| 1470 | + if: steps.cache.outputs.cache-hit != 'true' |
| 1471 | + with: |
| 1472 | + key: ${{ runner.os }}-${{ steps.toolchain.outputs.cachekey }}-${{ hashFiles('semver/**/Cargo.lock') }}-${{ github.job }}-rustdoc |
| 1473 | + path: subject/target/semver-checks/cache |
| 1474 | + |
1386 | 1475 | init-release:
|
1387 | 1476 | name: Run the release workflow
|
1388 | 1477 | needs:
|
|
0 commit comments