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:
|
|
|
|
|
2022-08-19 08:28:57 +00:00
|
|
|
env:
|
2023-02-15 03:37:10 +00:00
|
|
|
NWAKU_VERSION: "v0.15.0"
|
2022-12-12 05:22:17 +00:00
|
|
|
NODE_JS: "18"
|
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
|
|
|
|
- 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
|
|
|
|
- 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
|
|
|
|
- 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:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
2022-08-19 15:00:23 +00:00
|
|
|
- name: Get nwaku
|
2022-08-19 13:26:31 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
2022-08-19 15:00:23 +00:00
|
|
|
mkdir -p nwaku/build
|
|
|
|
cd nwaku
|
|
|
|
wget "https://github.com/status-im/nwaku/releases/download/${NWAKU_VERSION}/nim-waku-ubuntu-latest.tar.gz"
|
2022-08-19 13:26:31 +00:00
|
|
|
tar xavf nim-waku-ubuntu-latest.tar.gz
|
|
|
|
- name: Ensure wakunode2 is ready
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
uname -a
|
2022-08-19 15:00:23 +00:00
|
|
|
cd nwaku/build
|
2022-08-19 13:26:31 +00:00
|
|
|
./wakunode2 --help
|
|
|
|
- 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-11-22 17:17:04 +00:00
|
|
|
- run: npm run test:node
|
2021-05-10 10:18:26 +00:00
|
|
|
env:
|
2022-11-22 17:23:15 +00:00
|
|
|
DEBUG: ""
|
2021-03-26 01:38:04 +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:
|
|
|
|
name: debug.log
|
|
|
|
path: debug.log
|
|
|
|
|
|
|
|
- name: Upload nwaku logs on failure
|
2022-11-17 02:01:00 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-03-26 01:38:04 +00:00
|
|
|
if: failure()
|
|
|
|
with:
|
2022-08-19 15:00:23 +00:00
|
|
|
name: nwaku-logs
|
2022-11-17 01:42:37 +00:00
|
|
|
path: packages/tests/log/
|
2022-08-19 09:22:35 +00:00
|
|
|
|
2022-05-27 11:18:36 +00:00
|
|
|
node_with_go_waku:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
2023-02-22 23:57:24 +00:00
|
|
|
GO_WAKU_VERSION: "0.5.1"
|
2022-10-30 22:35:59 +00:00
|
|
|
WAKU_SERVICE_NODE_DIR: ../../go-waku
|
2022-08-25 04:26:47 +00:00
|
|
|
WAKU_SERVICE_NODE_BIN: ./waku
|
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
|
|
|
|
|
|
|
|
- name: Get go-waku
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
pwd
|
|
|
|
mkdir -p go-waku/
|
|
|
|
cd go-waku
|
|
|
|
wget "https://github.com/status-im/go-waku/releases/download/v${GO_WAKU_VERSION}/gowaku-${GO_WAKU_VERSION}-x86_64.deb"
|
|
|
|
sudo apt install ./gowaku-${GO_WAKU_VERSION}-x86_64.deb
|
|
|
|
cp $(which waku) ./
|
|
|
|
|
|
|
|
- name: Ensure go-waku is ready
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
uname -a
|
2022-10-30 22:35:59 +00:00
|
|
|
cd packages/core
|
2022-08-25 04:26:47 +00:00
|
|
|
cd "${WAKU_SERVICE_NODE_DIR}"
|
|
|
|
"${WAKU_SERVICE_NODE_BIN}" --version
|
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-01-30 09:30:31 +00:00
|
|
|
- run: npm run build:esm
|
2022-11-22 17:17:04 +00:00
|
|
|
- run: npm run test:node
|
2022-05-27 11:18:36 +00:00
|
|
|
env:
|
|
|
|
DEBUG: "waku:nwaku*,waku:test*"
|
|
|
|
|
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*"
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
submodules: "recursive"
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Install NodeJS
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: ${{ env.NODE_JS }}
|
|
|
|
|
|
|
|
- name: Pull nwaku origin/master
|
|
|
|
run: |
|
|
|
|
cd nwaku
|
|
|
|
git fetch origin
|
|
|
|
git checkout origin/master
|
|
|
|
|
2023-03-02 23:31:34 +00:00
|
|
|
- uses: ./.github/actions/npm
|
2022-11-15 04:08:39 +00:00
|
|
|
|
|
|
|
- name: build nwaku
|
|
|
|
run: |
|
|
|
|
cd packages/tests
|
|
|
|
npm run nwaku:force-build
|
|
|
|
|
|
|
|
- name: Ensure wakunode2 is ready
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
uname -a
|
|
|
|
cd nwaku
|
|
|
|
./build/wakunode2 --help
|
|
|
|
|
2023-01-30 09:30:31 +00:00
|
|
|
- run: npm run build:esm
|
2022-11-22 17:17:04 +00:00
|
|
|
- run: npm run test:node
|
2022-11-15 04:08:39 +00:00
|
|
|
env:
|
|
|
|
DEBUG: "waku:nwaku*,waku:test*"
|
|
|
|
|
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
|
|
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
|
|
|
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
|
|
|
|
if: ${{ steps.release.outputs.release_created }}
|
|
|
|
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
if: ${{ steps.release.outputs.release_created }}
|
|
|
|
with:
|
|
|
|
node-version: ${{ env.NODE_JS }}
|
|
|
|
registry-url: "https://registry.npmjs.org"
|
|
|
|
|
|
|
|
- run: npm install
|
|
|
|
if: ${{ steps.release.outputs.release_created }}
|
|
|
|
|
|
|
|
- run: npm run build
|
|
|
|
if: ${{ steps.release.outputs.release_created }}
|
|
|
|
|
|
|
|
- run: npm publish --workspaces --next --access public
|
|
|
|
if: ${{ steps.release.outputs.release_created }}
|
|
|
|
env:
|
|
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|