From 1f98f608d7a5cb6e4eb3a593b0d243561d52e6a0 Mon Sep 17 00:00:00 2001 From: James Eversole Date: Tue, 21 Jan 2025 13:12:35 -0600 Subject: [PATCH] 6-w-caching --- .gitea/workflows/test-and-build.yml | 46 +++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/.gitea/workflows/test-and-build.yml b/.gitea/workflows/test-and-build.yml index a4c4a28..e8de405 100644 --- a/.gitea/workflows/test-and-build.yml +++ b/.gitea/workflows/test-and-build.yml @@ -21,6 +21,31 @@ jobs: - name: Checkout code uses: actions/checkout@v3 + - name: Set up cache for Cabal + uses: actions/cache@v3 + with: + path: | + ~/.cabal + ~/.ghc + key: cabal-${{ runner.os }}-${{ hashFiles('cabal.project') }} + restore-keys: | + cabal-${{ runner.os }}- + + - name: Set up cache for Nix + uses: actions/cache@v3 + with: + path: | + /nix/store + /nix/var/nix/cache + key: nix-${{ runner.os }}-${{ hashFiles('flake.nix') }} + restore-keys: | + nix-${{ runner.os }}- + + - name: Initialize Cabal and update package list + run: | + cabal update + cabal configure + - name: Install dependencies and run tests run: | nix develop --command cabal test @@ -36,7 +61,28 @@ jobs: - name: Checkout code uses: actions/checkout@v3 + - name: Set up cache for Cabal + uses: actions/cache@v3 + with: + path: | + ~/.cabal + ~/.ghc + key: cabal-${{ runner.os }}-${{ hashFiles('cabal.project') }} + restore-keys: | + cabal-${{ runner.os }}- + + - name: Set up cache for Nix + uses: actions/cache@v3 + with: + path: | + /nix/store + /nix/var/nix/cache + key: nix-${{ runner.os }}-${{ hashFiles('flake.nix') }} + restore-keys: | + nix-${{ runner.os }}- + - name: Build binary run: | nix build ls -alh ./result/bin/tricu +