2023-09-12 17:33:34 +03:00
|
|
|
name: Run Test
|
2023-09-12 15:28:46 +03:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
nim_wakunode_image:
|
2023-09-12 17:33:34 +03:00
|
|
|
required: true
|
|
|
|
type: string
|
|
|
|
test_type:
|
|
|
|
required: true
|
2023-09-12 15:28:46 +03:00
|
|
|
type: string
|
|
|
|
|
|
|
|
env:
|
|
|
|
NODE_JS: "18"
|
|
|
|
RETRY_ATTEMPTS: 3
|
2023-09-12 17:59:31 +03:00
|
|
|
WAKU_SERVICE_NODE_PARAMS: ${{ (inputs.test_type == 'go-waku-master') && '--min-relay-peers-to-publish=0' || '' }}
|
2023-09-12 18:12:18 +03:00
|
|
|
DEBUG: ${{ (inputs.test_type == 'go-waku-master' || inputs.test_type == 'nwaku-master') && 'waku*' || '' }}
|
2023-09-12 15:28:46 +03:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
node:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
2023-09-12 17:33:34 +03:00
|
|
|
WAKUNODE_IMAGE: ${{ inputs.nim_wakunode_image }}
|
2023-09-12 15:28:46 +03:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
repository: waku-org/js-waku
|
|
|
|
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: ${{ env.NODE_JS }}
|
|
|
|
|
|
|
|
- uses: ./.github/actions/npm
|
|
|
|
|
|
|
|
- run: npm run build:esm
|
|
|
|
|
|
|
|
- uses: Wandalen/wretry.action@master
|
|
|
|
with:
|
|
|
|
attempt_limit: ${{ env.RETRY_ATTEMPTS }}
|
2023-09-12 17:59:31 +03:00
|
|
|
command: ${{ (inputs.test_type == 'node-optional') && 'npm run test:optional --workspace=@waku/tests' || 'npm run test:node' }}
|
2023-09-12 15:28:46 +03:00
|
|
|
|
|
|
|
- name: Upload debug logs on failure
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
if: failure()
|
|
|
|
with:
|
2023-09-12 17:33:34 +03:00
|
|
|
name: ${{ inputs.test_type }}-debug.log
|
2023-09-12 15:28:46 +03:00
|
|
|
path: debug.log
|
|
|
|
|
2023-09-12 17:33:34 +03:00
|
|
|
- name: Upload logs on failure
|
2023-09-12 15:28:46 +03:00
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
if: failure()
|
|
|
|
with:
|
2023-09-12 17:33:34 +03:00
|
|
|
name: ${{ inputs.test_type }}-logs
|
2023-09-12 15:28:46 +03:00
|
|
|
path: packages/tests/log/
|