Skip to content

Commit

Permalink
refactor: use Cachix
Browse files Browse the repository at this point in the history
  • Loading branch information
farbodahm committed Nov 6, 2024
1 parent 6c39ebb commit a7a0e5b
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,37 @@ on:
jobs:
ubuntu_tests:
runs-on: ubuntu-latest
permissions:
actions: write
contents: read
id-token: write
steps:
- uses: actions/checkout@v4

# Add a separate step to adjust permissions
- name: Adjust Permissions on Nix Store
run: sudo mkdir /nix && sudo chown -R $USER:$USER /nix/
# - name: Adjust Permissions on Nix Store
# run: sudo mkdir /nix && sudo chown -R $USER:$USER /nix/

- name: Cache Nix Store
uses: actions/cache@v3
with:
path: /nix/store
key: nix-store-${{ runner.os }}-${{ hashFiles('**/shell.nix') }}
restore-keys: |
nix-store-${{ runner.os }}-
# - name: Cache Nix Store
# uses: actions/cache@v3
# with:
# path: /nix/store
# key: nix-store-${{ runner.os }}-${{ hashFiles('**/shell.nix') }}
# restore-keys: |
# nix-store-${{ runner.os }}-

- name: Show caches packages
run: ls /nix/store
# - name: Show caches packages
# run: ls /nix/store

- uses: cachix/install-nix-action@v26

- uses: cachix/cachix-action@v14
with:
name: devenv
- uses: DeterminateSystems/magic-nix-cache-action@main

- name: Install devenv.sh
run: nix profile install nixpkgs#devenv

- name: Build the devenv shell and run any pre-commit hooks
run: ls /nix/store && nix-store --verify --check-contents
run: devenv test

macos_tests:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
Expand Down

0 comments on commit a7a0e5b

Please sign in to comment.