From 768082f180375a46db67deb943e231c4bcfde455 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Th=C3=A9riault?= Date: Wed, 15 Jan 2020 00:20:55 -0500 Subject: [PATCH] Use caching in actions workflow --- .github/workflows/build.yml | 20 +++++++++++++++++--- .github/workflows/check.yml | 5 ++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bc75755..10e9447 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,18 +2,32 @@ name: Build on: [push, pull_request] jobs: build: + name: Build runs-on: ${{ matrix.os }} strategy: matrix: os: [ubuntu-latest, windows-latest, macOS-latest] steps: - - uses: actions/checkout@v1 - with: - fetch-depth: 1 + - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: toolchain: stable override: true + - name: Cache Cargo registry + uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + - name: Cache Cargo index + uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} + - name: Cache Cargo build + uses: actions/cache@v1 + with: + path: target + key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} - name: Build project uses: actions-rs/cargo@v1 with: diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index ce49869..f5d47ce 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -2,11 +2,10 @@ name: Checks on: [pull_request] jobs: checks: + name: Checks runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - with: - fetch-depth: 1 + - uses: actions/checkout@v2 - uses: actions-rs/toolchain@v1 with: toolchain: stable