From 4c9233e2c34553888c1dc27245bcb3f54e1ea958 Mon Sep 17 00:00:00 2001 From: fbarbu15 Date: Tue, 12 Sep 2023 15:28:46 +0300 Subject: [PATCH 01/15] split node from CI --- .github/workflows/ci.yml | 56 +++------------------------------ .github/workflows/test-node.yml | 51 ++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 52 deletions(-) create mode 100644 .github/workflows/test-node.yml 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/ From 1dbb1e56367afa8ce981d0836992a54811b8522b Mon Sep 17 00:00:00 2001 From: fbarbu15 Date: Tue, 12 Sep 2023 15:38:18 +0300 Subject: [PATCH 02/15] fix calling the node --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0014bbb30e..52c0a054b2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,8 +69,7 @@ jobs: - run: npm run test:browser node: - runs-on: ubuntu-latest - uses: ./.github/workflows/test-node.yml + uses: ./.github/workflows/test-node.yml@${{ github.ref }} with: nim_wakunode_image: ${{ inputs.nim_wakunode_image || 'statusteam/nim-waku:v0.19.0' }} From c3c31b192e7bea1ae52da970858b5edc51e70fa7 Mon Sep 17 00:00:00 2001 From: fbarbu15 Date: Tue, 12 Sep 2023 15:53:21 +0300 Subject: [PATCH 03/15] remove ref --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 52c0a054b2..8ad1d9f6d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,7 +69,7 @@ jobs: - run: npm run test:browser node: - uses: ./.github/workflows/test-node.yml@${{ github.ref }} + uses: ./.github/workflows/test-node.yml with: nim_wakunode_image: ${{ inputs.nim_wakunode_image || 'statusteam/nim-waku:v0.19.0' }} From 4683d246ea79967770445b4d915e6a247c7d3a6a Mon Sep 17 00:00:00 2001 From: fbarbu15 Date: Tue, 12 Sep 2023 17:33:34 +0300 Subject: [PATCH 04/15] make reusable test node workflow --- .github/workflows/ci.yml | 112 ++++---------------------------- .github/workflows/test-node.yml | 21 +++--- 2 files changed, 26 insertions(+), 107 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8ad1d9f6d5..b056f20118 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,111 +72,25 @@ jobs: uses: ./.github/workflows/test-node.yml with: nim_wakunode_image: ${{ inputs.nim_wakunode_image || 'statusteam/nim-waku:v0.19.0' }} + test_type: node node_optional: - 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:optional --workspace=@waku/tests - with: | - DEBUG: "" + uses: ./.github/workflows/test-node.yml + with: + nim_wakunode_image: ${{ inputs.nim_wakunode_image || 'statusteam/nim-waku:v0.19.0' }} + test_type: node-optional node_with_go_waku_master: - runs-on: ubuntu-latest - 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 - DEBUG: "waku*" - steps: - - uses: actions/checkout@v3 - with: - repository: waku-org/js-waku - - - name: Install NodeJS - 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: "waku:nwaku*,waku:test*" - - - name: Upload debug logs on failure - uses: actions/upload-artifact@v3 - if: failure() - with: - name: go-waku-debug.log - path: debug.log - - - name: Upload logs on failure - uses: actions/upload-artifact@v3 - if: failure() - with: - name: go-waku-logs - path: packages/tests/log/ + uses: ./.github/workflows/test-node.yml + with: + nim_wakunode_image: statusteam/go-waku:latest + test_type: go_waku_master node_with_nwaku_master: - runs-on: ubuntu-latest - env: - DEBUG: "waku*" - WAKUNODE_IMAGE: "statusteam/nim-waku:deploy-wakuv2-test" - 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: "waku:nwaku*,waku:test*" - - - name: Upload debug logs on failure - uses: actions/upload-artifact@v3 - if: failure() - with: - name: nwaku-master-debug.log - path: debug.log - - - name: Upload logs on failure - uses: actions/upload-artifact@v3 - if: failure() - with: - name: nwaku-master-logs - path: packages/tests/log/ + uses: ./.github/workflows/test-node.yml + with: + nim_wakunode_image: statusteam/nim-waku:deploy-wakuv2-test + test_type: nwaku_master maybe-release: name: release diff --git a/.github/workflows/test-node.yml b/.github/workflows/test-node.yml index 5fdcca15f6..858372329f 100644 --- a/.github/workflows/test-node.yml +++ b/.github/workflows/test-node.yml @@ -1,21 +1,26 @@ -name: Test Node +name: Run Test on: workflow_call: inputs: nim_wakunode_image: - required: false + required: true + type: string + test_type: + required: true type: string env: NODE_JS: "18" RETRY_ATTEMPTS: 3 + WAKU_SERVICE_NODE_PARAMS: ${{ (inputs.test_type == 'go_waku_master') && '--min-relay-peers-to-publish=0' || '' }} + DEBUG: ${{ (inputs.test_type == 'go_waku_master' || inputs.test_type == 'nwaku_master') && 'waku:nwaku*,waku:test*' || 'waku*' }} jobs: node: runs-on: ubuntu-latest env: - WAKUNODE_IMAGE: ${{ inputs.nim_wakunode_image || 'statusteam/nim-waku:v0.19.0' }} + WAKUNODE_IMAGE: ${{ inputs.nim_wakunode_image }} steps: - uses: actions/checkout@v3 with: @@ -32,20 +37,20 @@ jobs: - uses: Wandalen/wretry.action@master with: attempt_limit: ${{ env.RETRY_ATTEMPTS }} - command: npm run test:node + command: ${{ (inputs.test_type == 'node_optional') && 'npm run test:optional --workspace=@waku/tests' || 'npm run test:node' }} with: | - DEBUG: "" + DEBUG: ${{ env.DEBUG }} - name: Upload debug logs on failure uses: actions/upload-artifact@v3 if: failure() with: - name: debug.log + name: ${{ inputs.test_type }}-debug.log path: debug.log - - name: Upload nwaku logs on failure + - name: Upload logs on failure uses: actions/upload-artifact@v3 if: failure() with: - name: nwaku-logs + name: ${{ inputs.test_type }}-logs path: packages/tests/log/ From 27ec0752f6e7bd0701a53ca0c631fc89df529a97 Mon Sep 17 00:00:00 2001 From: fbarbu15 Date: Tue, 12 Sep 2023 17:59:31 +0300 Subject: [PATCH 05/15] small fix after ci run --- .github/workflows/ci.yml | 4 ++-- .github/workflows/test-node.yml | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b056f20118..6f95fc406c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -84,13 +84,13 @@ jobs: uses: ./.github/workflows/test-node.yml with: nim_wakunode_image: statusteam/go-waku:latest - test_type: go_waku_master + test_type: go-waku-master node_with_nwaku_master: uses: ./.github/workflows/test-node.yml with: nim_wakunode_image: statusteam/nim-waku:deploy-wakuv2-test - test_type: nwaku_master + test_type: nwaku-master maybe-release: name: release diff --git a/.github/workflows/test-node.yml b/.github/workflows/test-node.yml index 858372329f..eba295b441 100644 --- a/.github/workflows/test-node.yml +++ b/.github/workflows/test-node.yml @@ -13,8 +13,7 @@ on: env: NODE_JS: "18" RETRY_ATTEMPTS: 3 - WAKU_SERVICE_NODE_PARAMS: ${{ (inputs.test_type == 'go_waku_master') && '--min-relay-peers-to-publish=0' || '' }} - DEBUG: ${{ (inputs.test_type == 'go_waku_master' || inputs.test_type == 'nwaku_master') && 'waku:nwaku*,waku:test*' || 'waku*' }} + WAKU_SERVICE_NODE_PARAMS: ${{ (inputs.test_type == 'go-waku-master') && '--min-relay-peers-to-publish=0' || '' }} jobs: node: @@ -37,9 +36,9 @@ jobs: - uses: Wandalen/wretry.action@master with: attempt_limit: ${{ env.RETRY_ATTEMPTS }} - command: ${{ (inputs.test_type == 'node_optional') && 'npm run test:optional --workspace=@waku/tests' || 'npm run test:node' }} + command: ${{ (inputs.test_type == 'node-optional') && 'npm run test:optional --workspace=@waku/tests' || 'npm run test:node' }} with: | - DEBUG: ${{ env.DEBUG }} + DEBUG: ${{ (inputs.test_type == 'go-waku-master' || inputs.test_type == 'nwaku-master') && '"waku:nwaku*,waku:test*"' || "" }} - name: Upload debug logs on failure uses: actions/upload-artifact@v3 From a95202f8f5828904a6460185d43b8d51322ae8c5 Mon Sep 17 00:00:00 2001 From: fbarbu15 Date: Tue, 12 Sep 2023 18:00:45 +0300 Subject: [PATCH 06/15] small fix after ci run --- .github/workflows/test-node.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-node.yml b/.github/workflows/test-node.yml index eba295b441..cd35a661db 100644 --- a/.github/workflows/test-node.yml +++ b/.github/workflows/test-node.yml @@ -38,7 +38,7 @@ jobs: attempt_limit: ${{ env.RETRY_ATTEMPTS }} command: ${{ (inputs.test_type == 'node-optional') && 'npm run test:optional --workspace=@waku/tests' || 'npm run test:node' }} with: | - DEBUG: ${{ (inputs.test_type == 'go-waku-master' || inputs.test_type == 'nwaku-master') && '"waku:nwaku*,waku:test*"' || "" }} + DEBUG: ${{ (inputs.test_type == 'go-waku-master' || inputs.test_type == 'nwaku-master') && '"waku:nwaku*,waku:test*"' || `` }} - name: Upload debug logs on failure uses: actions/upload-artifact@v3 From 7fd6803ec1733202c00755d84327d49012a006f8 Mon Sep 17 00:00:00 2001 From: fbarbu15 Date: Tue, 12 Sep 2023 18:01:21 +0300 Subject: [PATCH 07/15] small fix after ci run --- .github/workflows/test-node.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-node.yml b/.github/workflows/test-node.yml index cd35a661db..dfc8b2cfc4 100644 --- a/.github/workflows/test-node.yml +++ b/.github/workflows/test-node.yml @@ -38,7 +38,7 @@ jobs: attempt_limit: ${{ env.RETRY_ATTEMPTS }} command: ${{ (inputs.test_type == 'node-optional') && 'npm run test:optional --workspace=@waku/tests' || 'npm run test:node' }} with: | - DEBUG: ${{ (inputs.test_type == 'go-waku-master' || inputs.test_type == 'nwaku-master') && '"waku:nwaku*,waku:test*"' || `` }} + DEBUG: ${{ (inputs.test_type == 'go-waku-master' || inputs.test_type == 'nwaku-master') && '"waku:nwaku*,waku:test*"' || '' }} - name: Upload debug logs on failure uses: actions/upload-artifact@v3 From 5b9935e11810550418677bd42c5886093683af11 Mon Sep 17 00:00:00 2001 From: fbarbu15 Date: Tue, 12 Sep 2023 18:12:18 +0300 Subject: [PATCH 08/15] fix debug mismatch --- .github/workflows/test-node.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-node.yml b/.github/workflows/test-node.yml index dfc8b2cfc4..322f8a5064 100644 --- a/.github/workflows/test-node.yml +++ b/.github/workflows/test-node.yml @@ -14,6 +14,7 @@ env: NODE_JS: "18" RETRY_ATTEMPTS: 3 WAKU_SERVICE_NODE_PARAMS: ${{ (inputs.test_type == 'go-waku-master') && '--min-relay-peers-to-publish=0' || '' }} + DEBUG: ${{ (inputs.test_type == 'go-waku-master' || inputs.test_type == 'nwaku-master') && 'waku*' || '' }} jobs: node: @@ -37,8 +38,6 @@ jobs: with: attempt_limit: ${{ env.RETRY_ATTEMPTS }} command: ${{ (inputs.test_type == 'node-optional') && 'npm run test:optional --workspace=@waku/tests' || 'npm run test:node' }} - with: | - DEBUG: ${{ (inputs.test_type == 'go-waku-master' || inputs.test_type == 'nwaku-master') && '"waku:nwaku*,waku:test*"' || '' }} - name: Upload debug logs on failure uses: actions/upload-artifact@v3 From 8eac2996540ce656fc43a995e5806f75b332d9df Mon Sep 17 00:00:00 2001 From: fbarbu15 Date: Wed, 13 Sep 2023 10:52:41 +0300 Subject: [PATCH 09/15] move node to action folder --- .github/{workflows => actions/node}/test-node.yml | 6 +++++- .github/workflows/ci.yml | 10 ++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) rename .github/{workflows => actions/node}/test-node.yml (92%) diff --git a/.github/workflows/test-node.yml b/.github/actions/node/test-node.yml similarity index 92% rename from .github/workflows/test-node.yml rename to .github/actions/node/test-node.yml index 322f8a5064..3609c3b8c0 100644 --- a/.github/workflows/test-node.yml +++ b/.github/actions/node/test-node.yml @@ -9,12 +9,16 @@ on: test_type: required: true type: string + debug: + required: false + type: string + default: '' env: NODE_JS: "18" RETRY_ATTEMPTS: 3 WAKU_SERVICE_NODE_PARAMS: ${{ (inputs.test_type == 'go-waku-master') && '--min-relay-peers-to-publish=0' || '' }} - DEBUG: ${{ (inputs.test_type == 'go-waku-master' || inputs.test_type == 'nwaku-master') && 'waku*' || '' }} + DEBUG: ${{ inputs.test_type }} jobs: node: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f95fc406c..b74648e60a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,28 +69,30 @@ jobs: - run: npm run test:browser node: - uses: ./.github/workflows/test-node.yml + uses: ./.github/actions/node/test-node.yml with: nim_wakunode_image: ${{ inputs.nim_wakunode_image || 'statusteam/nim-waku:v0.19.0' }} test_type: node node_optional: - uses: ./.github/workflows/test-node.yml + uses: ./.github/actions/node/test-node.yml with: nim_wakunode_image: ${{ inputs.nim_wakunode_image || 'statusteam/nim-waku:v0.19.0' }} test_type: node-optional node_with_go_waku_master: - uses: ./.github/workflows/test-node.yml + uses: ./.github/actions/node/test-node.yml with: nim_wakunode_image: statusteam/go-waku:latest test_type: go-waku-master + debug: waku* node_with_nwaku_master: - uses: ./.github/workflows/test-node.yml + uses: ./.github/actions/node/test-node.yml with: nim_wakunode_image: statusteam/nim-waku:deploy-wakuv2-test test_type: nwaku-master + debug: waku* maybe-release: name: release From c577b2cce88603404ef5f51eff6d32f7c700a831 Mon Sep 17 00:00:00 2001 From: fbarbu15 Date: Wed, 13 Sep 2023 10:55:33 +0300 Subject: [PATCH 10/15] add ref to the node call --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b74648e60a..8b36b766a5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,26 +69,26 @@ jobs: - run: npm run test:browser node: - uses: ./.github/actions/node/test-node.yml + uses: ./.github/actions/node/test-node.yml@${{ github.ref }} with: nim_wakunode_image: ${{ inputs.nim_wakunode_image || 'statusteam/nim-waku:v0.19.0' }} test_type: node node_optional: - uses: ./.github/actions/node/test-node.yml + uses: ./.github/actions/node/test-node.yml@${{ github.ref }} with: nim_wakunode_image: ${{ inputs.nim_wakunode_image || 'statusteam/nim-waku:v0.19.0' }} test_type: node-optional node_with_go_waku_master: - uses: ./.github/actions/node/test-node.yml + uses: ./.github/actions/node/test-node.yml@${{ github.ref }} with: nim_wakunode_image: statusteam/go-waku:latest test_type: go-waku-master debug: waku* node_with_nwaku_master: - uses: ./.github/actions/node/test-node.yml + uses: ./.github/actions/node/test-node.yml@${{ github.ref }} with: nim_wakunode_image: statusteam/nim-waku:deploy-wakuv2-test test_type: nwaku-master From 442e18cee77031e97c88b8c9a5d396d5cb5466e1 Mon Sep 17 00:00:00 2001 From: fbarbu15 Date: Wed, 13 Sep 2023 10:58:24 +0300 Subject: [PATCH 11/15] add sha to the node call --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b36b766a5..865f700ad4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,26 +69,26 @@ jobs: - run: npm run test:browser node: - uses: ./.github/actions/node/test-node.yml@${{ github.ref }} + uses: ./.github/actions/node/test-node.yml@${{ github.sha }} with: nim_wakunode_image: ${{ inputs.nim_wakunode_image || 'statusteam/nim-waku:v0.19.0' }} test_type: node node_optional: - uses: ./.github/actions/node/test-node.yml@${{ github.ref }} + uses: ./.github/actions/node/test-node.yml@${{ github.sha }} with: nim_wakunode_image: ${{ inputs.nim_wakunode_image || 'statusteam/nim-waku:v0.19.0' }} test_type: node-optional node_with_go_waku_master: - uses: ./.github/actions/node/test-node.yml@${{ github.ref }} + uses: ./.github/actions/node/test-node.yml@${{ github.sha }} with: nim_wakunode_image: statusteam/go-waku:latest test_type: go-waku-master debug: waku* node_with_nwaku_master: - uses: ./.github/actions/node/test-node.yml@${{ github.ref }} + uses: ./.github/actions/node/test-node.yml@${{ github.sha }} with: nim_wakunode_image: statusteam/nim-waku:deploy-wakuv2-test test_type: nwaku-master From a15b027c375e01edc964a3caa29818a42c73c15d Mon Sep 17 00:00:00 2001 From: fbarbu15 Date: Wed, 13 Sep 2023 11:00:28 +0300 Subject: [PATCH 12/15] remove file name from the node call --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 865f700ad4..5e69cf3e19 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,26 +69,26 @@ jobs: - run: npm run test:browser node: - uses: ./.github/actions/node/test-node.yml@${{ github.sha }} + uses: ./.github/actions/node with: nim_wakunode_image: ${{ inputs.nim_wakunode_image || 'statusteam/nim-waku:v0.19.0' }} test_type: node node_optional: - uses: ./.github/actions/node/test-node.yml@${{ github.sha }} + uses: ./.github/actions/node with: nim_wakunode_image: ${{ inputs.nim_wakunode_image || 'statusteam/nim-waku:v0.19.0' }} test_type: node-optional node_with_go_waku_master: - uses: ./.github/actions/node/test-node.yml@${{ github.sha }} + uses: ./.github/actions/node with: nim_wakunode_image: statusteam/go-waku:latest test_type: go-waku-master debug: waku* node_with_nwaku_master: - uses: ./.github/actions/node/test-node.yml@${{ github.sha }} + uses: ./.github/actions/node with: nim_wakunode_image: statusteam/nim-waku:deploy-wakuv2-test test_type: nwaku-master From 9baf52af5c9e2fa8d089bf14e17e90e7cf580811 Mon Sep 17 00:00:00 2001 From: fbarbu15 Date: Wed, 13 Sep 2023 11:12:01 +0300 Subject: [PATCH 13/15] move back node to workflows --- .github/actions/node/test-node.yml | 58 ------------------------------ .github/workflows/ci.yml | 8 ++--- 2 files changed, 4 insertions(+), 62 deletions(-) delete mode 100644 .github/actions/node/test-node.yml diff --git a/.github/actions/node/test-node.yml b/.github/actions/node/test-node.yml deleted file mode 100644 index 3609c3b8c0..0000000000 --- a/.github/actions/node/test-node.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: Run Test - -on: - workflow_call: - inputs: - nim_wakunode_image: - required: true - type: string - test_type: - required: true - type: string - debug: - required: false - type: string - default: '' - -env: - NODE_JS: "18" - RETRY_ATTEMPTS: 3 - WAKU_SERVICE_NODE_PARAMS: ${{ (inputs.test_type == 'go-waku-master') && '--min-relay-peers-to-publish=0' || '' }} - DEBUG: ${{ inputs.test_type }} - -jobs: - node: - runs-on: ubuntu-latest - env: - WAKUNODE_IMAGE: ${{ inputs.nim_wakunode_image }} - 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: ${{ (inputs.test_type == 'node-optional') && 'npm run test:optional --workspace=@waku/tests' || 'npm run test: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/ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5e69cf3e19..0d326e0561 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,26 +69,26 @@ jobs: - run: npm run test:browser node: - uses: ./.github/actions/node + uses: ./.github/workflows/test-node.yml with: nim_wakunode_image: ${{ inputs.nim_wakunode_image || 'statusteam/nim-waku:v0.19.0' }} test_type: node node_optional: - uses: ./.github/actions/node + uses: ./.github/workflows/test-node.yml with: nim_wakunode_image: ${{ inputs.nim_wakunode_image || 'statusteam/nim-waku:v0.19.0' }} test_type: node-optional node_with_go_waku_master: - uses: ./.github/actions/node + uses: ./.github/workflows/test-node.yml with: nim_wakunode_image: statusteam/go-waku:latest test_type: go-waku-master debug: waku* node_with_nwaku_master: - uses: ./.github/actions/node + uses: ./.github/workflows/test-node.yml with: nim_wakunode_image: statusteam/nim-waku:deploy-wakuv2-test test_type: nwaku-master From 7a52dd64a5a2c7d4299dcafd8f5f973e2992cee4 Mon Sep 17 00:00:00 2001 From: fbarbu15 Date: Wed, 13 Sep 2023 11:12:12 +0300 Subject: [PATCH 14/15] move back node to workflows --- .github/workflows/test-node.yml | 58 +++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/test-node.yml diff --git a/.github/workflows/test-node.yml b/.github/workflows/test-node.yml new file mode 100644 index 0000000000..3609c3b8c0 --- /dev/null +++ b/.github/workflows/test-node.yml @@ -0,0 +1,58 @@ +name: Run Test + +on: + workflow_call: + inputs: + nim_wakunode_image: + required: true + type: string + test_type: + required: true + type: string + debug: + required: false + type: string + default: '' + +env: + NODE_JS: "18" + RETRY_ATTEMPTS: 3 + WAKU_SERVICE_NODE_PARAMS: ${{ (inputs.test_type == 'go-waku-master') && '--min-relay-peers-to-publish=0' || '' }} + DEBUG: ${{ inputs.test_type }} + +jobs: + node: + runs-on: ubuntu-latest + env: + WAKUNODE_IMAGE: ${{ inputs.nim_wakunode_image }} + 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: ${{ (inputs.test_type == 'node-optional') && 'npm run test:optional --workspace=@waku/tests' || 'npm run test: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/ From 999e95a24a58acaff286cca98989eb2d5ec1e842 Mon Sep 17 00:00:00 2001 From: fbarbu15 Date: Wed, 13 Sep 2023 11:20:50 +0300 Subject: [PATCH 15/15] fix typo --- .github/workflows/test-node.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-node.yml b/.github/workflows/test-node.yml index 3609c3b8c0..81b5f2dc12 100644 --- a/.github/workflows/test-node.yml +++ b/.github/workflows/test-node.yml @@ -18,7 +18,7 @@ env: NODE_JS: "18" RETRY_ATTEMPTS: 3 WAKU_SERVICE_NODE_PARAMS: ${{ (inputs.test_type == 'go-waku-master') && '--min-relay-peers-to-publish=0' || '' }} - DEBUG: ${{ inputs.test_type }} + DEBUG: ${{ inputs.debug }} jobs: node: