From fd65e6de3dc1ff909a1419c3b8f0c76daf1a69ed Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Wed, 7 Apr 2021 23:17:55 +0900 Subject: use incremental build in ci (#10053) --- .github/workflows/ci.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to '.github') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a0fa4a54..da415dd6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,7 +44,7 @@ jobs: 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/')) }} env: - CARGO_INCREMENTAL: 0 + CARGO_INCREMENTAL: 1 RUST_BACKTRACE: full CARGO_TERM_COLOR: always @@ -55,10 +55,10 @@ jobs: - name: Clone repository uses: actions/checkout@v2 with: - # Use depth > 1, because sometimes we need to rebuild main and if - # other commits have landed it will become impossible to rebuild if - # the checkout is too shallow. - fetch-depth: 5 + # Disables shallow clone. We use full git history for restoring the mtime + # of each file to enable incremental build. + # See https://github.com/denoland/deno/pull/10053 + fetch-depth: 0 submodules: true - name: Create source tarballs (release, linux) @@ -160,6 +160,18 @@ jobs: cargo --version deno --version + - name: Restore timestamps + run: python ./tools/restore_mtime.py + + - name: Cache + uses: actions/cache@v2 + with: + path: | + ~/.cargo/git + ~/.cargo/registry + ./target + key: cache-1-${{ matrix.os }}-${{ matrix.kind }}-${{ hashFiles('Cargo.lock') }} + - name: test_format.js if: matrix.kind == 'lint' run: deno run --unstable --allow-write --allow-read --allow-run ./tools/format.js --check -- cgit v1.2.3