Skip to content

Commit

Permalink
fixup: Reduce simplify the use of the monitoring action
Browse files Browse the repository at this point in the history
  • Loading branch information
maru-ava committed Feb 22, 2025
1 parent d857661 commit 50f5ee8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
14 changes: 9 additions & 5 deletions .github/actions/run-monitored-tmpnet-cmd/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@ description: 'Run the provided command in an environment configured to monitor t

inputs:
run:
description: "the bash command to run"
description: "the bash script to run e.g. ./scripts/my-script.sh"
required: true
run_env:
description: 'a string containing env vars for the command e.g. "MY_VAR1=foo MY_VAR2=bar"'
default: ''
filter_by_owner:
default: ''
artifact_name:
default: 'tmpnet-data'
artifact_prefix:
default: ''
prometheus_username:
required: true
prometheus_password:
Expand Down Expand Up @@ -65,7 +68,8 @@ runs:
FILTER_BY_OWNER: ${{ inputs.filter_by_owner }}
- name: Run command
shell: bash
run: ${{ inputs.run }}
# --impure ensures the env vars are accessible to the command
run: ${{ inputs.run_env }} 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 +82,4 @@ runs:
uses: ./.github/actions/upload-tmpnet-artifact
if: always()
with:
name: ${{ inputs.artifact_name }}
name: ${{ inputs.artifact_prefix }}-tmpnet-data
12 changes: 7 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ jobs:
- 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
run_env: E2E_SERIAL=1
artifact_prefix: e2e
filter_by_owner: avalanchego-e2e
prometheus_username: ${{ secrets.PROMETHEUS_ID || '' }}
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
Expand All @@ -84,8 +85,9 @@ jobs:
- 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
run_env: E2E_SERIAL=1
artifact_prefix: e2e-existing-network
prometheus_username: ${{ secrets.PROMETHEUS_ID || '' }}
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
loki_username: ${{ secrets.LOKI_ID || '' }}
Expand All @@ -106,7 +108,7 @@ jobs:
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 50f5ee8

Please sign in to comment.