Skip to content

Commit

Permalink
fix: ci jobs only notify if discord secret available (#48)
Browse files Browse the repository at this point in the history
Signed-off-by: Barnabas Busa <barnabas.busa@ethereum.org>
  • Loading branch information
barnabasbusa authored Jul 2, 2024
1 parent ac17e89 commit 9473f89
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 7 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,21 @@ jobs:
echo "Skipping ./.github/tests/mix-with-tools-mev.yaml"
fi
- name: Check if Discord Webhook is Set
id: check_discord_webhook
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
run: |
if [ -z "$DISCORD_WEBHOOK" ]; then
echo "discord_webhook_set=false" >> $GITHUB_ENV
else
echo "discord_webhook_set=true" >> $GITHUB_ENV
fi
- name: Notify
if: cancelled() || failure()
if: (cancelled() || failure()) && env.discord_webhook_set == 'true'
uses: Ilshidur/action-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: "The nightly test for ${{matrix.file_name}} on ethereum-package has failed find it here ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
args: "The nightly test for ${{matrix.file_name}} on optimism-package has failed find it here ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
22 changes: 17 additions & 5 deletions .github/workflows/run-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:
workflow_dispatch:
schedule:
- cron: '0 2 * * *'
- cron: '0 2 * * *'

concurrency:
group: "scheduled-test"
Expand All @@ -30,6 +30,7 @@ jobs:
run: |
cat ~/.kube/config > kubeconfig
echo "kubeconfig=$(cat kubeconfig | base64 -w 0)" >> $GITHUB_OUTPUT
# run kurtosis test and assertoor
- name: Run kurtosis testnet
id: testnet
Expand All @@ -40,16 +41,27 @@ jobs:
kubernetes_config: "${{ steps.kubeconfig.outputs.kubeconfig }}"
kubernetes_cluster: "minikube"
kubernetes_storage_class: "standard"
ethereum_package_url: "github.com/ethpandaops/optimism-package"
ethereum_package_branch: "${{ github.head_ref || github.ref_name }}"
ethereum_package_branch: ""
ethereum_package_args: "${{ matrix.payload.file }}"
ethereum_package_url: "$GITHUB_WORKSPACE"
enclave_name: "optimism-package-${{ matrix.payload.name }}-${{ github.run_id }}"
persistent_logs: "true"

- name: Check if Discord Webhook is Set
id: check_discord_webhook
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
run: |
if [ -z "$DISCORD_WEBHOOK" ]; then
echo "discord_webhook_set=false" >> $GITHUB_ENV
else
echo "discord_webhook_set=true" >> $GITHUB_ENV
fi
- name: Notify
if: cancelled() || failure()
if: (cancelled() || failure()) && env.discord_webhook_set == 'true'
uses: Ilshidur/action-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
with:
args: "The k8s nightly/per PR test for ${{matrix.payload.name}} on optimism-package has failed find it here ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
args: "The k8s nightly/per PR test for ${{matrix.payload.name}} on optimism-package has failed. Find it here: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"

0 comments on commit 9473f89

Please sign in to comment.