From dcb7a1ed8920b307fd84809f60118d48f87964e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sat, 27 Apr 2024 11:41:31 +0100 Subject: [PATCH] add rust build cache on ci --- .forgejo/workflows/build.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.forgejo/workflows/build.yaml b/.forgejo/workflows/build.yaml index 0c297a2..ecbd512 100644 --- a/.forgejo/workflows/build.yaml +++ b/.forgejo/workflows/build.yaml @@ -11,6 +11,15 @@ jobs: - uses: actions/checkout@v3 name: Checkout - uses: https://github.com/DeterminateSystems/magic-nix-cache-action@main + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Run tests run: | nix develop -c cargo nextest run --run-ignored all @@ -23,6 +32,15 @@ jobs: - uses: actions/checkout@v3 name: Checkout - uses: https://github.com/DeterminateSystems/magic-nix-cache-action@main + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: run: | nix build @@ -35,6 +53,15 @@ jobs: run: | nix flake metadata - uses: https://github.com/DeterminateSystems/magic-nix-cache-action@main + - uses: actions/cache@v3 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Statix run: | nix develop -c statix check