From 63b5da0450b406d88e2be20bf0008c2879b01d0a Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Sun, 27 Dec 2020 22:08:22 +0000 Subject: [PATCH] use build cache on macos and windows too --- .github/workflows/linux.yml | 1 - .github/workflows/macos.yml | 25 +++++++++++++++++++++++++ .github/workflows/windows.yml | 25 +++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index e8a1db0ff..c91872b91 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -42,7 +42,6 @@ jobs: ~/.cargo/git ~/.cargo/bin key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-trimmed-${{ hashFiles('**/Cargo.lock') }} - - name: Cache cargo build uses: actions/cache@v2 with: diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index dc8558ac1..938f088db 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -29,6 +29,24 @@ jobs: profile: minimal override: true + - name: Generate Cargo.lock + uses: actions-rs/cargo@v1 + with: + command: generate-lockfile + - name: Cache cargo dirs + uses: actions/cache@v2 + with: + path: + ~/.cargo/registry + ~/.cargo/git + ~/.cargo/bin + key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-trimmed-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo build + uses: actions/cache@v2 + with: + path: target + key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-build-trimmed-${{ hashFiles('**/Cargo.lock') }} + - name: check build uses: actions-rs/cargo@v1 with: @@ -42,3 +60,10 @@ jobs: args: --all --all-features --no-fail-fast -- --nocapture --skip=test_h2_content_length --skip=test_reading_deflate_encoding_large_random_rustls + + - name: Clear the cargo caches + run: | + rustup update stable + rustup override set stable + cargo install cargo-cache --no-default-features --features ci-autoclean + cargo-cache diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d53d50a61..9f4930cb2 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -41,6 +41,24 @@ jobs: Get-ChildItem C:\vcpkg\installed\x64-windows\bin Get-ChildItem C:\vcpkg\installed\x64-windows\lib + - name: Generate Cargo.lock + uses: actions-rs/cargo@v1 + with: + command: generate-lockfile + - name: Cache cargo dirs + uses: actions/cache@v2 + with: + path: + ~/.cargo/registry + ~/.cargo/git + ~/.cargo/bin + key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-trimmed-${{ hashFiles('**/Cargo.lock') }} + - name: Cache cargo build + uses: actions/cache@v2 + with: + path: target + key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-build-trimmed-${{ hashFiles('**/Cargo.lock') }} + - name: check build uses: actions-rs/cargo@v1 with: @@ -62,3 +80,10 @@ jobs: --skip=test_connection_force_close --skip=test_connection_server_close --skip=test_connection_wait_queue_force_close + + - name: Clear the cargo caches + run: | + rustup update stable + rustup override set stable + cargo install cargo-cache --no-default-features --features ci-autoclean + cargo-cache