From 3de3aead23514f6a5938d0f41c16cc79e179204d Mon Sep 17 00:00:00 2001 From: Tom Foster Date: Tue, 23 Apr 2024 13:50:35 +0100 Subject: [PATCH] Refactor direnv and nix launch --- .github/workflows/ci.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e41d95b0..e2832234 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,17 +55,23 @@ jobs: echo "extra-substituters = ${{ env.ATTIC_ENDPOINT }}" >> /etc/nix/nix.conf echo "extra-trusted-public-keys = ${{ env.ATTIC_PUBLIC_KEY }}" >> /etc/nix/nix.conf - - name: Populate `/nix/store` and activate `direnv` + - name: Install and activate `direnv` + run: | + echo 'source $HOME/.nix-profile/share/nix-direnv/direnvrc' > "$HOME/.direnvrc" + nix-env -f "" -iA direnv -iA nix-direnv + + - name: Populate `/nix/store` run: | nix develop --command true - nix-env -f "" -iA direnv -iA nix-direnv - touch $HOME/.direnvrc - source $HOME/.direnvrc direnv allow + - name: Perform continuous integration + run: | + direnv exec . engage + - name: Build static targets run: | - /bin/nix-build-and-cache .#static-x86_64-unknown-linux-musl .#static-x86_64-unknown-linux-musl-jemalloc .#static-aarch64-unknown-linux-musl .#static-aarch64-unknown-linux-musl-jemalloc + bin/nix-build-and-cache .#static-x86_64-unknown-linux-musl .#static-x86_64-unknown-linux-musl-jemalloc .#static-aarch64-unknown-linux-musl .#static-aarch64-unknown-linux-musl-jemalloc - name: Organise and prepare static outputs run: | @@ -139,7 +145,7 @@ jobs: - name: Build OCI image targets run: | - /bin/nix-build-and-cache .#oci-image-x86_64-unknown-linux-musl .#oci-image-x86_64-unknown-linux-musl-jemalloc .#oci-image-aarch64-unknown-linux-musl .#oci-image-aarch64-unknown-linux-musl-jemalloc + bin/nix-build-and-cache .#oci-image-x86_64-unknown-linux-musl .#oci-image-x86_64-unknown-linux-musl-jemalloc .#oci-image-aarch64-unknown-linux-musl .#oci-image-aarch64-unknown-linux-musl-jemalloc - name: Organise OCI image outputs run: |