Skip to content

Commit c6c8e3c

Browse files
committed
fixup: Reduce simplify the use of the monitoring action
1 parent d857661 commit c6c8e3c

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

.github/actions/run-monitored-tmpnet-cmd/action.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ description: 'Run the provided command in an environment configured to monitor t
33

44
inputs:
55
run:
6-
description: "the bash command to run"
6+
description: "the bash script to run e.g. ./scripts/my-script.sh"
77
required: true
8+
run_env:
9+
description: 'a string containing env vars for the command e.g. "MY_VAR1=foo MY_VAR2=bar"'
10+
default: ''
811
filter_by_owner:
912
default: ''
10-
artifact_name:
11-
default: 'tmpnet-data'
13+
artifact_prefix:
14+
default: ''
1215
prometheus_username:
1316
required: true
1417
prometheus_password:
@@ -65,7 +68,7 @@ runs:
6568
FILTER_BY_OWNER: ${{ inputs.filter_by_owner }}
6669
- name: Run command
6770
shell: bash
68-
run: ${{ inputs.run }}
71+
run: ${{ inputs.run_env }} ${{ inputs.run }}
6972
env:
7073
TMPNET_DELAY_NETWORK_SHUTDOWN: true # Ensure shutdown waits for a final metrics scrape
7174
GH_REPO: ${{ inputs.repository_owner }}/${{ inputs.repository_name }}
@@ -78,4 +81,4 @@ runs:
7881
uses: ./.github/actions/upload-tmpnet-artifact
7982
if: always()
8083
with:
81-
name: ${{ inputs.artifact_name }}
84+
name: ${{ inputs.artifact_prefix }}-tmpnet-data

.github/workflows/ci.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ jobs:
6262
- name: Run e2e tests
6363
uses: ./.github/actions/run-monitored-tmpnet-cmd
6464
with:
65-
run: E2E_SERIAL=1 ./scripts/tests.e2e.sh
66-
artifact_name: e2e-tmpnet-data
65+
run: ./scripts/tests.e2e.sh
66+
run_env: E2E_SERIAL=1
67+
artifact_prefix: e2e
6768
filter_by_owner: avalanchego-e2e
6869
prometheus_username: ${{ secrets.PROMETHEUS_ID || '' }}
6970
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
@@ -84,8 +85,9 @@ jobs:
8485
- name: Run e2e tests with existing network
8586
uses: ./.github/actions/run-monitored-tmpnet-cmd
8687
with:
87-
run: E2E_SERIAL=1 ./scripts/tests.e2e.existing.sh
88-
artifact_name: e2e-existing-network-tmpnet-data
88+
run: ./scripts/tests.e2e.existing.sh
89+
run_env: E2E_SERIAL=1
90+
artifact_prefix: e2e-existing-network
8991
prometheus_username: ${{ secrets.PROMETHEUS_ID || '' }}
9092
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
9193
loki_username: ${{ secrets.LOKI_ID || '' }}
@@ -106,7 +108,7 @@ jobs:
106108
uses: ./.github/actions/run-monitored-tmpnet-cmd
107109
with:
108110
run: ./scripts/tests.upgrade.sh
109-
artifact_name: upgrade-tmpnet-data
111+
artifact_prefix: upgrade
110112
prometheus_username: ${{ secrets.PROMETHEUS_ID || '' }}
111113
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
112114
loki_username: ${{ secrets.LOKI_ID || '' }}

0 commit comments

Comments
 (0)