Skip to content

Commit

Permalink
test: RLN with actions
Browse files Browse the repository at this point in the history
  • Loading branch information
romanzac committed Feb 12, 2024
1 parent 25afac4 commit 5235658
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 53 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/nim_waku_rln.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Nim Waku RLN

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: false

on:
push:
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"
caller: "nim"
107 changes: 54 additions & 53 deletions .github/workflows/test_common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ env:
NODE_2: ${{ inputs.node2 }}
ADDITIONAL_NODES: ${{ inputs.additional_nodes }}
CALLER: ${{ inputs.caller || 'manual' }}
RLN_CREDENTIALS: ${{ secrets.RLN_CREDENTIALS }}

jobs:

Expand All @@ -48,57 +49,57 @@ jobs:
- run: pip install -r requirements.txt

- name: Run tests
run: pytest -n 4 --reruns 1 --alluredir=allure-results
run: pytest tests/relay/test_rln.py

- 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/${{ env.CALLER }}
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
destination_dir: ${{ env.CALLER }}

- 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/${{ env.CALLER }}/${{ 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() && env.CALLER != 'manual'
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 }}
# - 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/${{ env.CALLER }}
# 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
# destination_dir: ${{ env.CALLER }}
#
# - 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/${{ env.CALLER }}/${{ 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() && env.CALLER != 'manual'
# 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 }}

0 comments on commit 5235658

Please sign in to comment.