From c7a11ab3c859e890da9e1eeb7aa84cd651c4cf71 Mon Sep 17 00:00:00 2001 From: Flouse <1297478+Flouse@users.noreply.github.com> Date: Sat, 14 Oct 2023 04:18:56 +0000 Subject: [PATCH] chore: fix out-of-disk in the `rust.yml` workflow Fix Unhandled exception. System.IO.IOException: No space left on device : '/home/runner/runners/2.309.0 --- .github/workflows/rust.yml | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6d4b49df2..36cfc822d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -3,10 +3,10 @@ name: Build and Test on: [push, pull_request] jobs: - build: + build-and-test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive - name: Install Rust components @@ -17,7 +17,10 @@ jobs: ~/.cargo/registry ~/.cargo/git target - key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }} + key: ${{ runner.os }}-${{ runner.arch }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-${{ runner.arch }}-cargo-test + ${{ runner.os }}-${{ runner.arch }}-cargo - name: Install moleculec v0.7.2 run: CARGO_TARGET_DIR=target/ cargo install moleculec --version 0.7.2 - name: Check format @@ -42,7 +45,28 @@ jobs: git submodule update --init --recursive --depth=1 make all-via-docker - - name: Tests + - name: Tests all targets run: RUST_BACKTRACE=1 cargo test --all-targets - - name: Test TOML serialization - run: cargo run --bin godwoken -- generate-example-config -o test.toml + + test-generate-example-config: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Cache of Cargo + id: cargo-test-cache + uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-${{ runner.arch }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-${{ runner.arch }}-cargo-build + ${{ runner.os }}-${{ runner.arch }}-cargo + - name: Test TOML serialization + run: cargo run --bin godwoken -- generate-example-config -o test.toml