# WARNING: This workflow is used by upstream workflows (jswaku, nwaku, gowaku) via workflow_call. # DO NOT modify the name, inputs, or other parts of this workflow that might break upstream CI. name: Run Test on: workflow_call: # IMPORTANT: Do not change the name or properties of these inputs. # If you add new required inputs make sure that they have default value or you make the change upstream as well inputs: nim_wakunode_image: required: true type: string test_type: required: true type: string debug: required: false type: string default: '' allure_reports: required: false type: boolean default: false env: NODE_JS: "18" # Ensure test type conditions remain consistent. WAKU_SERVICE_NODE_PARAMS: ${{ (inputs.test_type == 'go-waku-master') && '--min-relay-peers-to-publish=0' || '' }} DEBUG: ${{ inputs.debug }} jobs: node: runs-on: ubuntu-latest env: WAKUNODE_IMAGE: ${{ inputs.nim_wakunode_image }} ALLURE_REPORTS: ${{ inputs.allure_reports }} 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 - run: ${{ (inputs.test_type == 'node-optional') && 'npm run test:optional --workspace=@waku/tests' || 'npm run test:node' }} - name: Get allure history if: always() && env.ALLURE_REPORTS == 'true' uses: actions/checkout@v3 continue-on-error: true with: ref: gh-pages path: gh-pages - name: Setup allure report if: always() && env.ALLURE_REPORTS == 'true' uses: simple-elf/allure-report-action@master id: allure-report with: allure_results: packages/tests/allure-results gh_pages: gh-pages/node allure_history: allure-history keep_reports: 10 - name: Deploy report to Github Pages if: always() && env.ALLURE_REPORTS == 'true' uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_branch: gh-pages publish_dir: allure-history destination_dir: node - name: Upload debug logs on failure uses: actions/upload-artifact@v3 if: failure() with: name: ${{ inputs.test_type }}-debug.log path: debug.log - name: Upload logs on failure uses: actions/upload-artifact@v3 if: failure() with: name: ${{ inputs.test_type }}-logs path: packages/tests/log/