2021-03-15 03:42:36 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
2022-05-02 06:32:56 +00:00
|
|
|
- "master"
|
|
|
|
- "staging"
|
|
|
|
- "trying"
|
2021-03-15 03:42:36 +00:00
|
|
|
pull_request:
|
2023-08-24 11:03:44 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
nim_wakunode_image:
|
2023-08-29 17:17:35 +00:00
|
|
|
description: "Docker hub image name taken from https://hub.docker.com/r/statusteam/nim-waku/tags. Format: statusteam/nim-waku:v0.19.0"
|
2023-08-24 11:03:44 +00:00
|
|
|
required: false
|
|
|
|
type: string
|
2021-03-15 03:42:36 +00:00
|
|
|
|
2022-08-19 08:28:57 +00:00
|
|
|
env:
|
2022-12-12 05:22:17 +00:00
|
|
|
NODE_JS: "18"
|
2023-08-31 10:27:25 +00:00
|
|
|
RETRY_ATTEMPTS: 3
|
2022-08-19 08:28:57 +00:00
|
|
|
|
2021-03-15 03:42:36 +00:00
|
|
|
jobs:
|
2022-11-02 03:11:21 +00:00
|
|
|
check:
|
2022-08-19 13:26:31 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2023-09-08 08:38:31 +00:00
|
|
|
with:
|
|
|
|
repository: waku-org/js-waku
|
|
|
|
|
2022-08-19 13:26:31 +00:00
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: ${{ env.NODE_JS }}
|
2023-03-02 23:31:34 +00:00
|
|
|
- uses: ./.github/actions/npm
|
2022-08-19 13:26:31 +00:00
|
|
|
- run: npm run build
|
2022-11-01 08:48:44 +00:00
|
|
|
- run: npm run check
|
|
|
|
- run: npm run doc
|
2021-03-15 03:42:36 +00:00
|
|
|
|
2022-08-19 13:26:31 +00:00
|
|
|
proto:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2023-09-08 08:38:31 +00:00
|
|
|
with:
|
|
|
|
repository: waku-org/js-waku
|
2022-08-19 13:26:31 +00:00
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: ${{ env.NODE_JS }}
|
2023-03-02 23:31:34 +00:00
|
|
|
- uses: ./.github/actions/npm
|
2021-04-20 00:02:47 +00:00
|
|
|
- name: Generate protobuf code
|
2022-05-30 05:25:00 +00:00
|
|
|
run: |
|
|
|
|
npm run proto
|
|
|
|
npm run fix
|
2021-04-20 00:02:47 +00:00
|
|
|
- name: Check all protobuf code was committed
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2022-01-04 22:05:07 +00:00
|
|
|
res=$(git status --short --ignore-submodules)
|
|
|
|
echo -n "'$res'" # For debug purposes
|
|
|
|
[ $(echo -n "$res"|wc -l) -eq 0 ]
|
2021-04-20 00:02:47 +00:00
|
|
|
|
2022-08-19 13:26:31 +00:00
|
|
|
browser:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2023-09-08 08:38:31 +00:00
|
|
|
with:
|
|
|
|
repository: waku-org/js-waku
|
2022-08-19 13:26:31 +00:00
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: ${{ env.NODE_JS }}
|
2023-03-02 23:31:34 +00:00
|
|
|
- uses: ./.github/actions/npm
|
2023-01-30 09:30:31 +00:00
|
|
|
- run: npm run build:esm
|
2022-08-19 13:26:31 +00:00
|
|
|
- run: npm run test:browser
|
2021-03-15 03:42:36 +00:00
|
|
|
|
2022-08-19 13:26:31 +00:00
|
|
|
node:
|
2023-09-12 12:53:21 +00:00
|
|
|
uses: ./.github/workflows/test-node.yml
|
2023-09-12 12:28:46 +00:00
|
|
|
with:
|
|
|
|
nim_wakunode_image: ${{ inputs.nim_wakunode_image || 'statusteam/nim-waku:v0.19.0' }}
|
2022-08-19 09:22:35 +00:00
|
|
|
|
2023-08-07 08:27:16 +00:00
|
|
|
node_optional:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
2023-09-08 08:38:31 +00:00
|
|
|
WAKUNODE_IMAGE: ${{ inputs.nim_wakunode_image || 'statusteam/nim-waku:v0.19.0' }}
|
2023-08-29 17:17:35 +00:00
|
|
|
|
2023-08-07 08:27:16 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2023-09-08 08:38:31 +00:00
|
|
|
with:
|
|
|
|
repository: waku-org/js-waku
|
2023-08-07 08:27:16 +00:00
|
|
|
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: ${{ env.NODE_JS }}
|
|
|
|
|
|
|
|
- uses: ./.github/actions/npm
|
2023-08-31 10:27:25 +00:00
|
|
|
|
2023-08-07 08:27:16 +00:00
|
|
|
- run: npm run build:esm
|
2023-08-31 10:27:25 +00:00
|
|
|
|
|
|
|
- uses: Wandalen/wretry.action@master
|
|
|
|
with:
|
|
|
|
attempt_limit: ${{ env.RETRY_ATTEMPTS }}
|
|
|
|
command: npm run test:optional --workspace=@waku/tests
|
|
|
|
with: |
|
|
|
|
DEBUG: ""
|
2023-08-07 08:27:16 +00:00
|
|
|
|
2023-04-17 04:59:36 +00:00
|
|
|
node_with_go_waku_master:
|
2022-05-27 11:18:36 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
2023-04-17 04:59:36 +00:00
|
|
|
WAKUNODE_IMAGE: "statusteam/go-waku:latest"
|
2022-05-27 11:18:36 +00:00
|
|
|
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
|
2023-09-08 08:38:31 +00:00
|
|
|
with:
|
|
|
|
repository: waku-org/js-waku
|
2022-05-27 11:18:36 +00:00
|
|
|
|
|
|
|
- name: Install NodeJS
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
2022-09-05 11:02:01 +00:00
|
|
|
node-version: ${{ env.NODE_JS }}
|
2022-05-27 11:18:36 +00:00
|
|
|
|
2023-03-02 23:31:34 +00:00
|
|
|
- uses: ./.github/actions/npm
|
2023-08-31 10:27:25 +00:00
|
|
|
|
2023-01-30 09:30:31 +00:00
|
|
|
- run: npm run build:esm
|
2023-08-31 10:27:25 +00:00
|
|
|
|
|
|
|
- uses: Wandalen/wretry.action@master
|
|
|
|
with:
|
|
|
|
attempt_limit: ${{ env.RETRY_ATTEMPTS }}
|
|
|
|
command: npm run test:node
|
|
|
|
with: |
|
|
|
|
DEBUG: "waku:nwaku*,waku:test*"
|
2022-05-27 11:18:36 +00:00
|
|
|
|
2022-11-17 01:53:51 +00:00
|
|
|
- name: Upload debug logs on failure
|
2022-11-17 02:01:00 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-11-17 01:53:51 +00:00
|
|
|
if: failure()
|
|
|
|
with:
|
2022-11-17 02:01:00 +00:00
|
|
|
name: go-waku-debug.log
|
2022-11-17 01:53:51 +00:00
|
|
|
path: debug.log
|
|
|
|
|
2022-05-27 11:18:36 +00:00
|
|
|
- name: Upload logs on failure
|
2022-11-17 02:01:00 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-05-27 11:18:36 +00:00
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: go-waku-logs
|
2022-11-17 01:42:37 +00:00
|
|
|
path: packages/tests/log/
|
2022-11-15 04:08:39 +00:00
|
|
|
|
|
|
|
node_with_nwaku_master:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
DEBUG: "waku*"
|
2023-04-17 04:59:36 +00:00
|
|
|
WAKUNODE_IMAGE: "statusteam/nim-waku:deploy-wakuv2-test"
|
2022-11-15 04:08:39 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2023-09-08 08:38:31 +00:00
|
|
|
with:
|
|
|
|
repository: waku-org/js-waku
|
2022-11-15 04:08:39 +00:00
|
|
|
|
2023-04-17 04:59:36 +00:00
|
|
|
- uses: actions/setup-node@v3
|
2022-11-15 04:08:39 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ env.NODE_JS }}
|
|
|
|
|
2023-03-02 23:31:34 +00:00
|
|
|
- uses: ./.github/actions/npm
|
2023-08-31 10:27:25 +00:00
|
|
|
|
2023-01-30 09:30:31 +00:00
|
|
|
- run: npm run build:esm
|
2023-08-31 10:27:25 +00:00
|
|
|
|
|
|
|
- uses: Wandalen/wretry.action@master
|
|
|
|
with:
|
|
|
|
attempt_limit: ${{ env.RETRY_ATTEMPTS }}
|
|
|
|
command: npm run test:node
|
|
|
|
with: |
|
|
|
|
DEBUG: "waku:nwaku*,waku:test*"
|
2022-11-15 04:08:39 +00:00
|
|
|
|
2022-11-17 01:53:51 +00:00
|
|
|
- name: Upload debug logs on failure
|
2022-11-17 02:01:00 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-11-17 01:53:51 +00:00
|
|
|
if: failure()
|
|
|
|
with:
|
2022-11-17 02:01:00 +00:00
|
|
|
name: nwaku-master-debug.log
|
2022-11-17 01:53:51 +00:00
|
|
|
path: debug.log
|
|
|
|
|
2022-11-15 04:08:39 +00:00
|
|
|
- name: Upload logs on failure
|
2022-11-17 02:01:00 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2022-11-15 04:08:39 +00:00
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: nwaku-master-logs
|
2022-11-17 01:42:37 +00:00
|
|
|
path: packages/tests/log/
|
2023-02-09 22:13:51 +00:00
|
|
|
|
|
|
|
maybe-release:
|
|
|
|
name: release
|
|
|
|
runs-on: ubuntu-latest
|
2023-09-12 12:28:46 +00:00
|
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
2023-02-09 22:13:51 +00:00
|
|
|
needs: [check, proto, browser, node]
|
|
|
|
steps:
|
|
|
|
- uses: google-github-actions/release-please-action@v3
|
|
|
|
id: release
|
|
|
|
with:
|
|
|
|
command: manifest
|
|
|
|
monorepo-tags: true
|
2023-03-10 11:46:52 +00:00
|
|
|
token: ${{ secrets.CI_TOKEN }}
|
2023-02-09 22:13:51 +00:00
|
|
|
|
|
|
|
- uses: actions/checkout@v3
|
2023-09-08 08:38:31 +00:00
|
|
|
with:
|
|
|
|
repository: waku-org/js-waku
|
2023-03-16 20:05:19 +00:00
|
|
|
if: ${{ steps.release.outputs.releases_created }}
|
2023-02-09 22:13:51 +00:00
|
|
|
|
|
|
|
- uses: actions/setup-node@v3
|
2023-03-16 20:05:19 +00:00
|
|
|
if: ${{ steps.release.outputs.releases_created }}
|
2023-02-09 22:13:51 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ env.NODE_JS }}
|
|
|
|
registry-url: "https://registry.npmjs.org"
|
|
|
|
|
|
|
|
- run: npm install
|
2023-03-16 20:05:19 +00:00
|
|
|
if: ${{ steps.release.outputs.releases_created }}
|
2023-02-09 22:13:51 +00:00
|
|
|
|
|
|
|
- run: npm run build
|
2023-03-16 20:05:19 +00:00
|
|
|
if: ${{ steps.release.outputs.releases_created }}
|
2023-02-09 22:13:51 +00:00
|
|
|
|
2023-03-29 08:36:37 +00:00
|
|
|
- run: npm run publish
|
2023-03-16 20:05:19 +00:00
|
|
|
if: ${{ steps.release.outputs.releases_created }}
|
2023-03-29 08:36:37 +00:00
|
|
|
env:
|
|
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_JS_WAKU_PUBLISH }}
|