159 lines
4.1 KiB
YAML
Raw Normal View History

name: CI
on:
push:
branches:
2022-05-02 16:32:56 +10:00
- "master"
- "staging"
- "trying"
pull_request:
env:
NWAKU_VERSION: "v0.11"
NODE_JS: "16"
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
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_JS }}
- uses: bahmutov/npm-install@v1
- run: npm run build
2022-11-01 19:48:44 +11:00
- run: npm run check
- run: npm run doc
2022-08-19 23:26:31 +10:00
proto:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_JS }}
- uses: bahmutov/npm-install@v1
- name: Generate protobuf code
2022-05-30 15:25:00 +10:00
run: |
npm run proto
npm run fix
- 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 ]
2022-08-19 23:26:31 +10:00
browser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_JS }}
- uses: bahmutov/npm-install@v1
2022-11-02 14:11:21 +11:00
- run: npm run build
2022-08-19 23:26:31 +10:00
- run: npm run test:browser
2022-08-19 23:26:31 +10:00
node:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get nwaku
2022-08-19 23:26:31 +10:00
shell: bash
run: |
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 23:26:31 +10:00
tar xavf nim-waku-ubuntu-latest.tar.gz
- name: Ensure wakunode2 is ready
shell: bash
run: |
uname -a
cd nwaku/build
2022-08-19 23:26:31 +10:00
./wakunode2 --help
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_JS }}
- uses: bahmutov/npm-install@v1
2022-11-02 14:11:21 +11:00
- run: npm run build
2022-08-19 23:26:31 +10:00
- run: npm run test:node
env:
DEBUG: "waku:nwaku*,waku:test*"
2021-03-26 12:38:04 +11:00
- name: Upload logs on failure
uses: actions/upload-artifact@v2
if: failure()
with:
name: nwaku-logs
2021-03-26 12:38:04 +11:00
path: log/
2022-08-19 19:22:35 +10:00
2022-05-27 21:18:36 +10:00
node_with_go_waku:
runs-on: ubuntu-latest
env:
2022-09-16 12:29:40 +10:00
GO_WAKU_VERSION: "0.2.2"
2022-10-31 09:35:59 +11:00
WAKU_SERVICE_NODE_DIR: ../../go-waku
2022-08-25 14:26:47 +10:00
WAKU_SERVICE_NODE_BIN: ./waku
2022-05-27 21:18:36 +10: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-31 09:35:59 +11:00
cd packages/core
2022-08-25 14:26:47 +10:00
cd "${WAKU_SERVICE_NODE_DIR}"
"${WAKU_SERVICE_NODE_BIN}" --version
2022-05-27 21:18:36 +10:00
- name: Install NodeJS
uses: actions/setup-node@v3
with:
2022-09-05 21:02:01 +10:00
node-version: ${{ env.NODE_JS }}
2022-05-27 21:18:36 +10:00
- uses: bahmutov/npm-install@v1
2022-11-02 14:11:21 +11:00
- run: npm run build
2022-05-27 21:18:36 +10:00
- run: npm run test:node
env:
DEBUG: "waku:nwaku*,waku:test*"
- name: Upload logs on failure
uses: actions/upload-artifact@v2
if: failure()
with:
name: go-waku-logs
path: log/
release:
name: Release
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
2022-11-02 14:11:21 +11:00
needs: [check, proto, browser, node]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 'lts/*'
- name: Install dependencies
run: npm ci
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release