From 732a0a7f8a7e4b6d774d4a6be98c205794257507 Mon Sep 17 00:00:00 2001 From: pragmaxim Date: Tue, 27 Aug 2024 07:46:32 +0200 Subject: [PATCH] github-workflows-caching --- .github/workflows/ci.yml | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d128f85..b186cd6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,30 @@ jobs: - name: Checkout the repository uses: actions/checkout@v3 + - name: Cache cargo registry + uses: actions/cache@v3 + with: + path: ~/.cargo/registry + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo-registry- + + - name: Cache cargo index + uses: actions/cache@v3 + with: + path: ~/.cargo/index + key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-cargo-index- + + - name: Cache cargo build + uses: actions/cache@v3 + with: + path: target + key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('**/Cargo.toml') }} + restore-keys: | + ${{ runner.os }}-cargo-build- + - name: Set up Rust uses: actions-rs/toolchain@v1 with: @@ -23,9 +47,6 @@ jobs: profile: minimal components: rustfmt, clippy - - name: Install wasm-pack - run: cargo install wasm-pack - - name: Build and Start the Actix-Web Server run: | cargo build --manifest-path server/Cargo.toml @@ -38,6 +59,9 @@ jobs: sleep 2 done + - name: Install wasm-pack + run: cargo install wasm-pack + - name: Run WebAssembly Tests with wasm-bindgen-test run: | cd reqwest-client