Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ci jobs only notify if discord secret available #48

Merged
merged 4 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}"