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 24, 2025
1 parent 1f297ce commit 260259e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 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
3 changes: 3 additions & 0 deletions .github/actions/run-monitored-tmpnet-cmd/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ inputs:
runs:
using: composite
steps:
# Ensure promtail and prometheus are available
- name: Install nix
uses: ./.github/actions/install-nix
- name: Start prometheus
# Only run for the original repo; a forked repo won't have access to the monitoring credentials
if: (inputs.prometheus_username != '')
Expand Down
17 changes: 1 addition & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ 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"
- name: Build AvalancheGo Binary
shell: bash
run: ./scripts/build.sh -r
Expand All @@ -75,10 +70,6 @@ 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"
- name: Build AvalancheGo Binary
shell: bash
run: ./scripts/build.sh -r
Expand All @@ -97,10 +88,6 @@ 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"
- name: Build AvalancheGo Binary
shell: bash
run: ./scripts/build.sh
Expand Down Expand Up @@ -233,9 +220,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 }}
- uses: ./.github/actions/install-nix
- run: nix develop --command echo "dependencies installed"
- name: Run e2e tests
shell: bash
Expand Down

0 comments on commit 260259e

Please sign in to comment.