From ae3addb61983be8e5e0e923efbc42e716d69fce8 Mon Sep 17 00:00:00 2001 From: Roman Zajic Date: Thu, 18 Jan 2024 20:17:17 +0800 Subject: [PATCH] chore: custom test workflows (#13) * chore: separate interop test workflows for Go and Nim - common test workflow - reporting to Discord * fix: define GITHUB_STEP_SUMMARY * fix: remove GITHUB_STEP_SUMMARY def for global env * fix: move GITHUB_STEP_SUMMARY after run * fix: add dollar sign to GITHUB_STEP_SUMMARY * fix: proper quoting - GITHUB_STEP_SUMMARY * fix: unique concurrency groups * fix: variable expansion for curl * fix: variable substitution * fix: use Discord action instead of curl * fix: use GITHUB_OUTPUT * fix: remove doubled echo * fix: secrets inherit * test: directly refer to step summary * test: GITHUB_STEP_SUMMARY behavior * fix: syntax * fix: syntax 2 * test: cat content of backing file * test: re-run with tests * fix: error in text format * fix: error in text format 2 * fix: error in text format 3 * fix: error in text format 4 * fix: error in text format 5 * test: env variable passing * test: re-run with tests * test: override description info * fix: set different schedule for Nim and Go tests - print job.status * fix: adjust wording for job.status * fix: add event and actor info * fix: add color based on result * fix: remove redundant dash * test: logical expression for color * fix: forgotten dollar * test: re-rerun with tests * fix: remove on push trigger --- .github/workflows/go_waku_daily.yml | 21 +++++++++++ .github/workflows/nim_waku_daily.yml | 21 +++++++++++ .../workflows/{test.yml => test_common.yml} | 37 ++++++++++++------- 3 files changed, 65 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/go_waku_daily.yml create mode 100644 .github/workflows/nim_waku_daily.yml rename .github/workflows/{test.yml => test_common.yml} (70%) diff --git a/.github/workflows/go_waku_daily.yml b/.github/workflows/go_waku_daily.yml new file mode 100644 index 0000000000..73dedb2436 --- /dev/null +++ b/.github/workflows/go_waku_daily.yml @@ -0,0 +1,21 @@ +name: Go Waku Interop Tests + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: false + +on: + schedule: + - cron: '0 3 * * *' + workflow_dispatch: + +jobs: + test-common: + uses: ./.github/workflows/test_common.yml + secrets: inherit + with: + node1: "harbor.status.im/wakuorg/go-waku:latest" + node2: "harbor.status.im/wakuorg/go-waku:latest" + + + diff --git a/.github/workflows/nim_waku_daily.yml b/.github/workflows/nim_waku_daily.yml new file mode 100644 index 0000000000..aae683ae74 --- /dev/null +++ b/.github/workflows/nim_waku_daily.yml @@ -0,0 +1,21 @@ +name: Nim Waku Interop Tests + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: false + +on: + schedule: + - cron: '0 4 * * *' + workflow_dispatch: + +jobs: + test-common: + uses: ./.github/workflows/test_common.yml + secrets: inherit + with: + node1: "harbor.status.im/wakuorg/nwaku:latest" + node2: "harbor.status.im/wakuorg/nwaku:latest" + + + diff --git a/.github/workflows/test.yml b/.github/workflows/test_common.yml similarity index 70% rename from .github/workflows/test.yml rename to .github/workflows/test_common.yml index 939cde9369..8654d04962 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test_common.yml @@ -1,16 +1,7 @@ -name: Interop Tests - -concurrency: - group: Interop-tests - cancel-in-progress: false +name: Interop Tests Common on: - schedule: - - cron: '0 3 * * *' - pull_request: - branches: - - master - workflow_dispatch: + workflow_call: inputs: node1: required: true @@ -28,6 +19,7 @@ on: type: string default: "harbor.status.im/wakuorg/nwaku:latest,harbor.status.im/wakuorg/go-waku:latest,harbor.status.im/wakuorg/nwaku:latest" + env: FORCE_COLOR: "1" NODE_1: ${{ inputs.node1 }} @@ -70,7 +62,7 @@ jobs: gh_pages: gh-pages allure_history: allure-history keep_reports: 30 - + - name: Deploy report to Github Pages uses: peaceiris/actions-gh-pages@v3 if: always() @@ -83,8 +75,25 @@ jobs: if: always() run: | echo "## Run Information" >> $GITHUB_STEP_SUMMARY + echo "- **Event**: ${{ github.event_name }}" >> $GITHUB_STEP_SUMMARY + echo "- **Actor**: ${{ github.actor }}" >> $GITHUB_STEP_SUMMARY echo "- **Node1**: ${{ env.NODE_1 }}" >> $GITHUB_STEP_SUMMARY - echo "- **Node2**: ${{ env.NODE_2}}" >> $GITHUB_STEP_SUMMARY - echo "- **Additonal Nodes**: ${{ env.ADDITIONAL_NODES}}" >> $GITHUB_STEP_SUMMARY + echo "- **Node2**: ${{ env.NODE_2 }}" >> $GITHUB_STEP_SUMMARY + echo "- **Additonal Nodes**: ${{ env.ADDITIONAL_NODES }}" >> $GITHUB_STEP_SUMMARY echo "## Test Results" >> $GITHUB_STEP_SUMMARY echo "Allure report will be available at: https://waku-org.github.io/waku-interop-tests/${{ github.run_number }}" >> $GITHUB_STEP_SUMMARY + { + echo 'JOB_SUMMARY<> $GITHUB_ENV + + - name: Send report to Discord + uses: rjstone/discord-webhook-notify@v1 + if: always() + with: + severity: ${{ job.status == 'success' && 'info' || 'error' }} + username: ${{ github.workflow }} + description: "## Job Result: ${{ job.status }}" + details: ${{ env.JOB_SUMMARY }} + webhookUrl: ${{ secrets.DISCORD_TEST_REPORTS_WH }}