Roman Zajic ae3addb619
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
2024-01-18 20:17:17 +08:00

100 lines
3.1 KiB
YAML

name: Interop Tests Common
on:
workflow_call:
inputs:
node1:
required: true
description: "Node that usually publishes messages. Used for all tests"
type: string
default: "harbor.status.im/wakuorg/go-waku:latest"
node2:
required: true
description: "Node that usually queries for published messages. Used for all tests"
type: string
default: "harbor.status.im/wakuorg/nwaku:latest"
additional_nodes:
required: false
description: "Additional optional nodes used in e2e tests, separated by ,"
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 }}
NODE_2: ${{ inputs.node2 }}
ADDITIONAL_NODES: ${{ inputs.additional_nodes }}
jobs:
tests:
name: tests
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.12'
cache: 'pip'
- run: pip install -r requirements.txt
- name: Run tests
run: pytest -n 4 --reruns 1 --alluredir=allure-results
- name: Get allure history
if: always()
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages
- name: Setup allure report
uses: simple-elf/allure-report-action@master
if: always()
id: allure-report
with:
allure_results: allure-results
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()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: allure-history
- name: Create job summary
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 "## 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<<EOF'
cat $GITHUB_STEP_SUMMARY
echo EOF
} >> $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 }}