Skip to content

Commit

Permalink
fixup: Cleanup action usage
Browse files Browse the repository at this point in the history
  • Loading branch information
maru-ava committed Feb 22, 2025
1 parent d857661 commit 6060ccd
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 22 deletions.
16 changes: 16 additions & 0 deletions .github/actions/install-nix/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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"
11 changes: 7 additions & 4 deletions .github/actions/run-monitored-tmpnet-cmd/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ inputs:
required: true
filter_by_owner:
default: ''
artifact_name:
default: 'tmpnet-data'
artifact_prefix:
default: ''
# TODO(marun) Supply these to the command
env:
default: {}
prometheus_username:
required: true
prometheus_password:
Expand Down Expand Up @@ -65,7 +68,7 @@ runs:
FILTER_BY_OWNER: ${{ inputs.filter_by_owner }}
- name: Run command
shell: bash
run: ${{ inputs.run }}
run: nix develop --impure --command bash -x ${{ inputs.run }}
env:
TMPNET_DELAY_NETWORK_SHUTDOWN: true # Ensure shutdown waits for a final metrics scrape
GH_REPO: ${{ inputs.repository_owner }}/${{ inputs.repository_name }}
Expand All @@ -78,4 +81,4 @@ runs:
uses: ./.github/actions/upload-tmpnet-artifact
if: always()
with:
name: ${{ inputs.artifact_name }}
name: ${{ inputs.artifact_prefix }}-tmpnet-data
30 changes: 12 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,18 @@ 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
- name: Run e2e tests
uses: ./.github/actions/run-monitored-tmpnet-cmd
with:
run: E2E_SERIAL=1 ./scripts/tests.e2e.sh
artifact_name: e2e-tmpnet-data
run: ./scripts/tests.e2e.sh
artifact_prefix: e2e
filter_by_owner: avalanchego-e2e
env:
E2E_SERIAL: 1
prometheus_username: ${{ secrets.PROMETHEUS_ID || '' }}
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
loki_username: ${{ secrets.LOKI_ID || '' }}
Expand All @@ -74,18 +72,17 @@ 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
- name: Run e2e tests with existing network
uses: ./.github/actions/run-monitored-tmpnet-cmd
with:
run: E2E_SERIAL=1 ./scripts/tests.e2e.existing.sh
artifact_name: e2e-existing-network-tmpnet-data
run: ./scripts/tests.e2e.existing.sh
artifact_prefix: e2e-existing-network
env:
E2E_SERIAL: 1
prometheus_username: ${{ secrets.PROMETHEUS_ID || '' }}
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
loki_username: ${{ secrets.LOKI_ID || '' }}
Expand All @@ -95,18 +92,15 @@ 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
- name: Run e2e tests
uses: ./.github/actions/run-monitored-tmpnet-cmd
with:
run: ./scripts/tests.upgrade.sh
artifact_name: upgrade-tmpnet-data
artifact_prefix: upgrade
prometheus_username: ${{ secrets.PROMETHEUS_ID || '' }}
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
loki_username: ${{ secrets.LOKI_ID || '' }}
Expand Down

0 comments on commit 6060ccd

Please sign in to comment.