Skip to content

Commit

Permalink
separate nix setup step and devbox install package step
Browse files Browse the repository at this point in the history
  • Loading branch information
LucilleH committed Sep 19, 2023
1 parent 6c5afb9 commit ddea841
Showing 1 changed file with 31 additions and 22 deletions.
53 changes: 31 additions & 22 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,6 @@ inputs:
runs:
using: "composite"
steps:
- name: Workaround for permission issue
if: inputs.enable-cache == 'true'
shell: bash
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
sudo chmod u+s "$(command -v gtar)"
else
sudo chmod u+s "$(command -v tar)"
fi
- name: Mount nix store cache
if: inputs.enable-cache == 'true'
uses: actions/cache@v3
with:
path: |
~/.nix-defexpr
~/.nix-profile
/nix/store
~/.local/state/nix
key: ${{ runner.os }}-devbox-${{ hashFiles(format('{0}/devbox.lock', inputs.project-path)) }}

- name: Get devbox version
shell: bash
env:
Expand Down Expand Up @@ -119,10 +98,40 @@ runs:
mkdir -p ~/.config/nix
echo "access-tokens = github.com=${{ github.token }}" >> ~/.config/nix/nix.conf
- name: Install nix and devbox packages
- name: Devbox setup Nix
shell: bash
run: |
export NIX_USER_COUNT=1
export NIX_INSTALLER_NO_CHANNEL_ADD=1
export NIX_BUILD_SHELL=/bin/bash
devbox setup nix
- name: Workaround nix store cache permission issue
if: inputs.enable-cache == 'true'
shell: bash
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
sudo rm -rf /nix/store/*
/usr/sbin/dseditgroup -o edit -t user \
-a "$(whoami)" "nixbld"
whoami
ls -al /nix/store
else
sudo chmod u+s "$(command -v tar)"
fi
- name: Mount nix store cache
if: inputs.enable-cache == 'true'
uses: actions/cache@v3
with:
path: |
~/.nix-defexpr
~/.nix-profile
/nix/store
~/.local/state/nix
key: ${{ runner.os }}-devbox-${{ hashFiles(format('{0}/devbox.lock', inputs.project-path)) }}

- name: Install devbox packages
shell: bash
run: |
devbox run --config=${{ inputs.project-path }} -- echo "Packages installed!"

0 comments on commit ddea841

Please sign in to comment.