From 7df9b8f7958fb21762a8ca321d5c0af1360bc092 Mon Sep 17 00:00:00 2001 From: Michel Heily Date: Thu, 30 Apr 2020 20:39:06 +0300 Subject: [PATCH] Add caching for cargo files in CI Former-commit-id: 04839f9f3f387c7d14391e0a8440eda42ed960e2 Former-commit-id: 56de0ffa4bbca27c3a125bcb78d0195c42068f7f --- .github/workflows/build.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5b3918e..084ce1d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,6 +21,22 @@ jobs: sudo apt-get install libsdl2-dev sudo apt-get install libsdl2-image-dev + - 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 run: cargo build --release --manifest-path platform/rustboyadvance-sdl2/Cargo.toml @@ -49,6 +65,22 @@ jobs: - run: rustup target add x86_64-pc-windows-msvc + - 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 run: cargo build --target x86_64-pc-windows-msvc --release --manifest-path .\platform\rustboyadvance-sdl2\Cargo.toml