Skip to content

Commit

Permalink
fixup: try to clean up to the max
Browse files Browse the repository at this point in the history
  • Loading branch information
maru-ava committed Jul 1, 2024
1 parent e52c6c1 commit ef42cbe
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 46 deletions.
46 changes: 46 additions & 0 deletions .github/actions/run-with-gh-env/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: 'Run a tmpnet test command'
description: 'Run the provided command with github environment variables set (helpful for enabling monitoring of tmpnet networks'

inputs:
artifact_prefix:
description: 'the prefix to use for the network dir artifact. If not provided, an artifact will not be collected'
default: ''
run:
description: "the bash command to run"
required: true
repo:
default: ${{ github.repository }}
workflow:
default: ${{ github.workflow }}
run_id:
default: ${{ github.run_id }}
run_number:
default: ${{ github.run_number }}
run_attempt:
default: ${{ github.run_attempt }}
job_id:
default: ${{ github.job }}


runs:
using: composite
steps:
- name: Run command
shell: bash
run: ${{ inputs.run }}
env:
GH_WORKFLOW: ${{ inputs.workflow }}
GH_RUN_ID: ${{ inputs.run_id }}
GH_RUN_NUMBER: ${{ inputs.run_number }}
GH_RUN_ATTEMPT: ${{ inputs.run_attempt }}
GH_JOB_ID: ${{ inputs.job }}
- name: Upload tmpnet network dir
uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ inputs.artifact_prefix }}-tmpnet-data
path: |
~/.tmpnet/networks
~/.tmpnet/prometheus/prometheus.log
~/.tmpnet/promtail/promtail.log
if-no-files-found: error
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ runs:
LOKI_PASSWORD: ${{ inputs.loki_password }}
- name: Notify of metrics availability
shell: bash
run: .github/workflows/notify-metrics-availability.sh
run: .github/actions/start-monitoring-tmpnet-networks/notify-metrics-availability.sh
env:
GRAFANA_URL: https://grafana-experimental.avax-dev.network/d/kBQpRdWnk/avalanche-main-dashboard?orgId=1&refresh=10s&var-filter=is_ephemeral_node%7C%3D%7Cfalse&var-filter=gh_repo%7C%3D%7Cava-labs%2Favalanchego&var-filter=gh_run_id%7C%3D%7C${{ inputs.run_id }}&var-filter=gh_run_attempt%7C%3D%7C${{ inputs.run_attempt }}
GH_JOB_ID: ${{ inputs.job }}
Expand Down
20 changes: 20 additions & 0 deletions .github/actions/upload-tmpnet-artifact/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Upload an artifact of tmpnet data'
description: 'Upload an artifact of data in the ~/.tmpnet path'

inputs:
name:
description: "the name of the artifact to upload"
required: true

runs:
using: composite
steps:
- name: Upload tmpnet data
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.name }}
path: |
~/.tmpnet/networks
~/.tmpnet/prometheus/prometheus.log
~/.tmpnet/promtail/promtail.log
if-no-files-found: error
57 changes: 12 additions & 45 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,25 +67,14 @@ jobs:
loki_id: ${{ secrets.LOKI_ID }}
loki_password: ${{ secrets.LOKI_PASSWORD }}
- name: Run e2e tests
shell: bash
run: E2E_SERIAL=1 ./scripts/tests.e2e.sh --delay-network-shutdown
env:
GH_REPO: ${{ github.repository }}
GH_WORKFLOW: ${{ github.workflow }}
GH_RUN_ID: ${{ github.run_id }}
GH_RUN_NUMBER: ${{ github.run_number }}
GH_RUN_ATTEMPT: ${{ github.run_attempt }}
GH_JOB_ID: ${{ github.job }}
uses: ./.github/actions/run-with-gh-env
with:
run: E2E_SERIAL=1 ./scripts/tests.e2e.sh --delay-network-shutdown
- name: Upload tmpnet network dir
uses: actions/upload-artifact@v4
uses: ./.github/actions/upload-tmpnet-artifact
if: always()
with:
name: e2e-tmpnet-data
path: |
~/.tmpnet/networks
~/.tmpnet/prometheus/prometheus.log
~/.tmpnet/promtail/promtail.log
if-no-files-found: error
e2e_existing_network:
runs-on: ubuntu-latest
steps:
Expand All @@ -104,25 +93,14 @@ jobs:
loki_id: ${{ secrets.LOKI_ID }}
loki_password: ${{ secrets.LOKI_PASSWORD }}
- name: Run e2e tests with existing network
shell: bash
run: E2E_SERIAL=1 ./scripts/tests.e2e.existing.sh --delay-network-shutdown
env:
GH_REPO: ${{ github.repository }}
GH_WORKFLOW: ${{ github.workflow }}
GH_RUN_ID: ${{ github.run_id }}
GH_RUN_NUMBER: ${{ github.run_number }}
GH_RUN_ATTEMPT: ${{ github.run_attempt }}
GH_JOB_ID: ${{ github.job }}
uses: ./.github/actions/run-with-gh-env
with:
run: E2E_SERIAL=1 ./scripts/tests.e2e.existing.sh --delay-network-shutdown
- name: Upload tmpnet network dir
uses: actions/upload-artifact@v4
uses: ./.github/actions/upload-tmpnet-artifact
if: always()
with:
name: e2e-existing-network-tmpnet-data
path: |
~/.tmpnet/networks
~/.tmpnet/prometheus/prometheus.log
~/.tmpnet/promtail/promtail.log
if-no-files-found: error
Upgrade:
runs-on: ubuntu-latest
steps:
Expand All @@ -141,25 +119,14 @@ jobs:
loki_id: ${{ secrets.LOKI_ID }}
loki_password: ${{ secrets.LOKI_PASSWORD }}
- name: Run e2e tests
shell: bash
run: ./scripts/tests.upgrade.sh
env:
GH_REPO: ${{ github.repository }}
GH_WORKFLOW: ${{ github.workflow }}
GH_RUN_ID: ${{ github.run_id }}
GH_RUN_NUMBER: ${{ github.run_number }}
GH_RUN_ATTEMPT: ${{ github.run_attempt }}
GH_JOB_ID: ${{ github.job }}
uses: ./.github/actions/run-with-gh-env
with:
run: ./scripts/tests.upgrade.sh
- name: Upload tmpnet network dir
uses: actions/upload-artifact@v4
uses: ./.github/actions/upload-tmpnet-artifact
if: always()
with:
name: upgrade-tmpnet-data
path: |
~/.tmpnet/networks
~/.tmpnet/prometheus/prometheus.log
~/.tmpnet/promtail/promtail.log
if-no-files-found: error
Lint:
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit ef42cbe

Please sign in to comment.