Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use synthetic mtime so the rustdoc build cache gets used. #399

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -772,16 +772,6 @@ jobs:
profile: minimal
override: true

- name: Restore cargo index and rustdoc target dir
uses: Swatinem/rust-cache@v2
with:
workspaces: |
subject/target/semver-checks/local-tokio-1_25_0
subject/target/semver-checks/local-tokio_macros-1_8_2
subject/target/semver-checks/local-tokio_stream-0_1_12
subject/target/semver-checks/local-tokio_test-0_4_2
subject/target/semver-checks/local-tokio_util-0_7_7

- name: Restore binary
id: cache-binary
uses: actions/cache/restore@v3
Expand All @@ -801,6 +791,21 @@ jobs:
key: ${{ runner.os }}-${{ hashFiles('.rustc-version', 'semver/**/Cargo.lock') }}-${{ github.job }}-rustdoc
path: subject/target/semver-checks/cache

- name: Restore cargo index and rustdoc target dir
uses: Swatinem/rust-cache@v2
with:
workspaces: |
subject/target/semver-checks/local-tokio-1_25_0
subject/target/semver-checks/local-tokio_macros-1_8_2
subject/target/semver-checks/local-tokio_stream-0_1_12
subject/target/semver-checks/local-tokio_test-0_4_2
subject/target/semver-checks/local-tokio_util-0_7_7

- name: Advance mtimes so that rustdoc build cache is used
run: |
export NEW_DATE="$(date -d '+1 hour')"
find subject/target/semver-checks/ -exec touch --date "$NEW_DATE" {} \;

# This test caught two bugs:
# - The default baseline was set to the current path instead of the default registry version.
# - Specifying `--exclude` together with a crate manifest that is within a workspace
Expand Down