From 7b3786983598c30a08b591c36f34b43c7aeec379 Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Fri, 9 Oct 2020 15:26:15 +0200 Subject: [PATCH] ci: add workaround for MacOS + Cargo + Github Actions cache bug (#7898) --- .github/workflows/ci.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a381bb757974c5..8ea91f21e5a59d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,6 +119,33 @@ jobs: restore-keys: | deno-${{ matrix.os }}-${{ matrix.kind }}- + # It seems that the 'target' directory does not always get restored + # from cache correctly on MacOS. In the build log we see the following: + # + # Fresh serde_derive v1.0.115 + # + # But a little while after that Cargo aborts because 'serde_derive' is + # now nowhere to be found. We're not the only ones experiencing this, + # see https://github.com/actions-rs/cargo/issues/111. + # + # error[E0463]: can't find crate for `serde_derive` + # ##[error] --> /Users/runner/.cargo/registry/src/github.com- + # | 1ecc6299db9ec823/serde-1.0.115/src/lib.rs:285:1 + # | + # 285 | extern crate serde_derive; + # | ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate + - name: Work around MacOS + Cargo + Github Actions cache bug + if: runner.os == 'macOS' + run: | + cargo clean --locked --release -p ast_node + cargo clean --locked --release -p is-macro + cargo clean --locked --release -p serde_derive + cargo clean --locked --release -p swc_ecma_codegen + cargo clean --locked --release -p swc_ecma_codegen_macros + cargo clean --locked --release -p swc_ecma_parser + cargo clean --locked --release -p swc_visit + cargo clean --locked --release -p swc_visit_macros + - name: lint.py if: matrix.kind == 'lint' run: python ./tools/lint.py