From aa940ccbbffac76a5348eaf28e4d2c00538321ae Mon Sep 17 00:00:00 2001 From: EETagent Date: Wed, 26 Oct 2022 14:37:29 +0200 Subject: [PATCH 1/2] devops: caching & improvements --- .github/workflows/rust.yml | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index cc042e1..c03a557 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -11,12 +11,32 @@ env: jobs: build: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --all --verbose + - name: Check out 🚚 + uses: actions/checkout@v3 + + - name: Install latest stable Rust toolchain 🦀 + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + default: true + - name: Set up cargo cache 📦 + uses: actions/cache@v3 + continue-on-error: false + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + restore-keys: ${{ runner.os }}-cargo- + - name: Build 🔨 + run: cargo build --verbose + - name: Run tests 🚀 + run: cargo test --all --verbose From 0a509c00803ab3632e4e48c3f09445c7872d09ff Mon Sep 17 00:00:00 2001 From: EETagent Date: Wed, 26 Oct 2022 14:44:49 +0200 Subject: [PATCH 2/2] style: spaces between action tasks --- .github/workflows/rust.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c03a557..c2cad19 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -24,6 +24,7 @@ jobs: toolchain: stable override: true default: true + - name: Set up cargo cache 📦 uses: actions/cache@v3 continue-on-error: false @@ -36,7 +37,9 @@ jobs: target/ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} restore-keys: ${{ runner.os }}-cargo- + - name: Build 🔨 run: cargo build --verbose + - name: Run tests 🚀 run: cargo test --all --verbose