Skip to content

Commit

Permalink
ci: Skip monitoring if secrets are not present (#1137)
Browse files Browse the repository at this point in the history
* `ci`: Skip monitoring if secrets are not present

Metrics and logs can only be collected if the required secrets are
present, but they will not be available to jobs executing against PRs
for forks.

* fixup: Respond to review comments

---------

Co-authored-by: Ceyhun Onur <ceyhun.onur@avalabs.org>
  • Loading branch information
marun and ceyonur authored Apr 8, 2024
1 parent 714b73c commit 9374d89
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,22 @@ jobs:
shell: bash
run: ./scripts/build.sh /tmp/e2e-test/avalanchego/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy
- name: Start prometheus
# Only run for the original repo; a forked repo won't have access to the monitoring credentials
if: (github.event.pull_request.head.repo.full_name == github.repository) || (github.event.repository.fork == false)
shell: bash
run: bash -x ./scripts/run_prometheus.sh
env:
PROMETHEUS_ID: ${{ secrets.PROMETHEUS_ID }}
PROMETHEUS_PASSWORD: ${{ secrets.PROMETHEUS_PASSWORD }}
- name: Start promtail
if: (github.event.pull_request.head.repo.full_name == github.repository) || (github.event.repository.fork == false)
shell: bash
run: bash -x ./scripts/run_promtail.sh
env:
LOKI_ID: ${{ secrets.LOKI_ID }}
LOKI_PASSWORD: ${{ secrets.LOKI_PASSWORD }}
- name: Notify of metrics availability
if: (github.event.pull_request.head.repo.full_name == github.repository) || (github.event.repository.fork == false)
shell: bash
run: .github/workflows/notify-metrics-availability.sh
env:
Expand Down Expand Up @@ -184,18 +188,22 @@ jobs:
shell: bash
run: ./scripts/build.sh /tmp/e2e-test/avalanchego/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy
- name: Start prometheus
# Only run for the original repo; a forked repo won't have access to the monitoring credentials
if: (github.event.pull_request.head.repo.full_name == github.repository) || (github.event.repository.fork == false)
shell: bash
run: bash -x ./scripts/run_prometheus.sh
env:
PROMETHEUS_ID: ${{ secrets.PROMETHEUS_ID }}
PROMETHEUS_PASSWORD: ${{ secrets.PROMETHEUS_PASSWORD }}
- name: Start promtail
if: (github.event.pull_request.head.repo.full_name == github.repository) || (github.event.repository.fork == false)
shell: bash
run: bash -x ./scripts/run_promtail.sh
env:
LOKI_ID: ${{ secrets.LOKI_ID }}
LOKI_PASSWORD: ${{ secrets.LOKI_PASSWORD }}
- name: Notify of metrics availability
if: (github.event.pull_request.head.repo.full_name == github.repository) || (github.event.repository.fork == false)
shell: bash
run: .github/workflows/notify-metrics-availability.sh
env:
Expand Down

0 comments on commit 9374d89

Please sign in to comment.