From dcb4aadcc2aad1e5e29d8e9ada1a461713d0219d Mon Sep 17 00:00:00 2001 From: Sebastian Estrella <2049686+sestrella@users.noreply.github.com> Date: Sun, 23 Jun 2024 20:46:49 -0500 Subject: [PATCH] Add magic cache --- .github/workflows/build.yml | 14 ++++++-------- flake.nix | 9 ++++++--- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1a999e91..29dfa00b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,10 +27,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v27 + - uses: DeterminateSystems/nix-installer-action@v12 with: - extra_nix_config: + extra-conf: accept-flake-config = true + - uses: DeterminateSystems/magic-nix-cache-action@v7 # https://input-output-hk.github.io/haskell.nix/tutorials/getting-started.html # with: # extra_nix_config: | @@ -45,17 +46,14 @@ jobs: # dist-newstyle # key: ${{ runner.os }}-${{ matrix.devShell }}-${{ hashFiles('*.cabal') }} # restore-keys: ${{ runner.os }}-${{ matrix.devShell }}- - - name: Uninstall GHCup - run: ghcup nuke - if: ${{ runner.os == 'Linux' }} # - name: Install packages / Print versions # run: | # ./bin/${{ matrix.devShell }} -c ghc --version # ./bin/${{ matrix.devShell }} -c cabal --version - - run: nix build + - name: Compile code + run: nix build timeout-minutes: 10 - - run: nix run .#test - timeout-minutes: 5 + # - run: nix run .#test # timeout-minutes: 5 # - name: Update package index # run: ./bin/${{ matrix.devShell }} -c cabal update diff --git a/flake.nix b/flake.nix index 4b97bb6b..46a2da43 100644 --- a/flake.nix +++ b/flake.nix @@ -31,12 +31,15 @@ }; flake = pkgs.hapistrano.flake { }; in - flake // { + flake // rec { apps.test = { type = "app"; - program = "${flake.packages."hapistrano:test:test"}/bin/test"; + program = "${packages.test}/bin/test"; + }; + packages = { + default = flake.packages."hapistrano:exe:hap"; + test = flake.packages."hapistrano:test:test"; }; - packages.default = flake.packages."hapistrano:exe:hap"; }); }