Skip to content

Commit 0c9fe11

Browse files
committed
fixup: Simplify nix installation with a custom action
1 parent c6c8e3c commit 0c9fe11

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: 'Install nix'
2+
description: 'Install nix and populate the store for the repo flake'
3+
4+
inputs:
5+
github_token:
6+
description: "github token to authenticate with to avoid being rate-limited"
7+
default: ${{ github.token }}
8+
required: false
9+
10+
runs:
11+
using: composite
12+
steps:
13+
- uses: cachix/install-nix-action@v30
14+
with:
15+
github_access_token: ${{ inputs.github_token }}
16+
- run: nix develop --command echo "dependencies installed"
17+
shell: bash

.github/workflows/ci.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@ jobs:
5151
steps:
5252
- uses: actions/checkout@v4
5353
- uses: ./.github/actions/setup-go-for-project
54-
- uses: cachix/install-nix-action@v30
55-
with:
56-
github_access_token: ${{ secrets.GITHUB_TOKEN }}
57-
# TODO(marun) Maybe figure out how to use `nix build` somehow i.e. make the default shell double as the default package
58-
- run: nix develop --command echo "dependencies installed"
54+
- uses: ./.github/actions/install-nix
5955
- name: Build AvalancheGo Binary
6056
shell: bash
6157
run: ./scripts/build.sh -r
@@ -75,10 +71,7 @@ jobs:
7571
steps:
7672
- uses: actions/checkout@v4
7773
- uses: ./.github/actions/setup-go-for-project
78-
- uses: cachix/install-nix-action@v30
79-
with:
80-
github_access_token: ${{ secrets.GITHUB_TOKEN }}
81-
- run: nix develop --command echo "dependencies installed"
74+
- uses: ./.github/actions/install-nix
8275
- name: Build AvalancheGo Binary
8376
shell: bash
8477
run: ./scripts/build.sh -r
@@ -97,10 +90,7 @@ jobs:
9790
steps:
9891
- uses: actions/checkout@v4
9992
- uses: ./.github/actions/setup-go-for-project
100-
- uses: cachix/install-nix-action@v30
101-
with:
102-
github_access_token: ${{ secrets.GITHUB_TOKEN }}
103-
- run: nix develop --command echo "dependencies installed"
93+
- uses: ./.github/actions/install-nix
10494
- name: Build AvalancheGo Binary
10595
shell: bash
10696
run: ./scripts/build.sh

0 commit comments

Comments
 (0)