diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 093fa7353c..0014bbb30e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,14 +13,6 @@ on: description: "Docker hub image name taken from https://hub.docker.com/r/statusteam/nim-waku/tags. Format: statusteam/nim-waku:v0.19.0" required: false type: string - workflow_call: - inputs: - nim_wakunode_image: - required: false - type: string - caller: - required: false - type: string env: NODE_JS: "18" @@ -29,7 +21,6 @@ env: jobs: check: runs-on: ubuntu-latest - if: ${{ inputs.caller == null || inputs.caller != 'nwaku' }} steps: - uses: actions/checkout@v3 with: @@ -45,7 +36,6 @@ jobs: proto: runs-on: ubuntu-latest - if: ${{ inputs.caller == null || inputs.caller != 'nwaku' }} steps: - uses: actions/checkout@v3 with: @@ -67,7 +57,6 @@ jobs: browser: runs-on: ubuntu-latest - if: ${{ inputs.caller == null || inputs.caller != 'nwaku' }} steps: - uses: actions/checkout@v3 with: @@ -81,41 +70,9 @@ jobs: node: runs-on: ubuntu-latest - env: - WAKUNODE_IMAGE: ${{ inputs.nim_wakunode_image || 'statusteam/nim-waku:v0.19.0' }} - 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 }} - command: npm run test:node - with: | - DEBUG: "" - - - name: Upload debug logs on failure - uses: actions/upload-artifact@v3 - if: failure() - with: - name: debug.log - path: debug.log - - - name: Upload nwaku logs on failure - uses: actions/upload-artifact@v3 - if: failure() - with: - name: nwaku-logs - path: packages/tests/log/ + uses: ./.github/workflows/test-node.yml + with: + nim_wakunode_image: ${{ inputs.nim_wakunode_image || 'statusteam/nim-waku:v0.19.0' }} node_optional: runs-on: ubuntu-latest @@ -144,7 +101,6 @@ jobs: node_with_go_waku_master: runs-on: ubuntu-latest - if: ${{ inputs.caller == null || inputs.caller != 'nwaku' }} env: WAKUNODE_IMAGE: "statusteam/go-waku:latest" WAKU_SERVICE_NODE_PARAMS: "--min-relay-peers-to-publish=0" # Can be removed once https://github.com/status-im/nwaku/issues/1004 is done @@ -186,7 +142,6 @@ jobs: node_with_nwaku_master: runs-on: ubuntu-latest - if: ${{ inputs.caller == null || inputs.caller != 'nwaku' }} env: DEBUG: "waku*" WAKUNODE_IMAGE: "statusteam/nim-waku:deploy-wakuv2-test" @@ -227,10 +182,7 @@ jobs: maybe-release: name: release runs-on: ubuntu-latest - if: > - github.event_name == 'push' && - github.ref == 'refs/heads/master' && - (github.event.inputs.caller == null || github.event.inputs.caller != 'nwaku') + if: github.event_name == 'push' && github.ref == 'refs/heads/master' needs: [check, proto, browser, node] steps: - uses: google-github-actions/release-please-action@v3 diff --git a/.github/workflows/test-node.yml b/.github/workflows/test-node.yml new file mode 100644 index 0000000000..5fdcca15f6 --- /dev/null +++ b/.github/workflows/test-node.yml @@ -0,0 +1,51 @@ +name: Test Node + +on: + workflow_call: + inputs: + nim_wakunode_image: + required: false + type: string + +env: + NODE_JS: "18" + RETRY_ATTEMPTS: 3 + +jobs: + node: + runs-on: ubuntu-latest + env: + WAKUNODE_IMAGE: ${{ inputs.nim_wakunode_image || 'statusteam/nim-waku:v0.19.0' }} + 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 }} + command: npm run test:node + with: | + DEBUG: "" + + - name: Upload debug logs on failure + uses: actions/upload-artifact@v3 + if: failure() + with: + name: debug.log + path: debug.log + + - name: Upload nwaku logs on failure + uses: actions/upload-artifact@v3 + if: failure() + with: + name: nwaku-logs + path: packages/tests/log/