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