Skip to content

Commit

Permalink
fixup: Simplify nix installation with a custom action
Browse files Browse the repository at this point in the history
  • Loading branch information
maru-ava committed Feb 22, 2025
1 parent 50f5ee8 commit d19e044
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
17 changes: 17 additions & 0 deletions .github/actions/install-nix/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 'Install nix'
description: 'Install nix and populate the store for the repo flake'

inputs:
github_token:
description: "github token to authenticate with to avoid being rate-limited"
default: ${{ github.token }}
required: false

runs:
using: composite
steps:
- uses: cachix/install-nix-action@v30
with:
github_access_token: ${{ inputs.github_token }}
- run: nix develop --command echo "dependencies installed"
shell: bash
16 changes: 3 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go-for-project
- uses: cachix/install-nix-action@v30
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
# TODO(marun) Maybe figure out how to use `nix build` somehow i.e. make the default shell double as the default package
- run: nix develop --command echo "dependencies installed"
- uses: ./.github/actions/install-nix
- name: Build AvalancheGo Binary
shell: bash
run: ./scripts/build.sh -r
Expand All @@ -75,10 +71,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go-for-project
- uses: cachix/install-nix-action@v30
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- run: nix develop --command echo "dependencies installed"
- uses: ./.github/actions/install-nix
- name: Build AvalancheGo Binary
shell: bash
run: ./scripts/build.sh -r
Expand All @@ -97,10 +90,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-go-for-project
- uses: cachix/install-nix-action@v30
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- run: nix develop --command echo "dependencies installed"
- uses: ./.github/actions/install-nix
- name: Build AvalancheGo Binary
shell: bash
run: ./scripts/build.sh
Expand Down

0 comments on commit d19e044

Please sign in to comment.