diff --git a/.github/actions/install-nix/action.yml b/.github/actions/install-nix/action.yml new file mode 100644 index 000000000000..49028a397dbb --- /dev/null +++ b/.github/actions/install-nix/action.yml @@ -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 diff --git a/.github/actions/run-monitored-tmpnet-cmd/action.yml b/.github/actions/run-monitored-tmpnet-cmd/action.yml index 873ae29fe731..d701a55ab3fc 100644 --- a/.github/actions/run-monitored-tmpnet-cmd/action.yml +++ b/.github/actions/run-monitored-tmpnet-cmd/action.yml @@ -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 != '') diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a0cf85d94804..2eb054755c8c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 @@ -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 @@ -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