js-waku/.github/workflows/ci.yml

80 lines
1.8 KiB
YAML
Raw Normal View History

name: CI
on:
push:
branches:
2022-05-02 06:32:56 +00:00
- "master"
- "staging"
- "trying"
pull_request:
jobs:
build_and_test:
2021-04-23 06:29:58 +00:00
env:
2022-05-02 06:32:56 +00:00
BUF_VERSION: "0.56.0"
NIM_WAKU_VERSION: "v0.9"
2021-04-21 03:47:28 +00:00
strategy:
matrix:
node: [16]
os: [ubuntu-latest]
2021-04-21 03:47:28 +00:00
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2.3.3
- name: Get nim-waku
shell: bash
run: |
mkdir -p nim-waku/build
cd nim-waku
2022-01-19 04:43:45 +00:00
wget "https://github.com/status-im/nim-waku/releases/download/${NIM_WAKU_VERSION}/nim-waku-ubuntu-latest.tar.gz"
tar xavf nim-waku-ubuntu-latest.tar.gz
2021-03-15 06:50:38 +00:00
- name: Install NodeJS
uses: actions/setup-node@v2
with:
2021-04-21 03:47:28 +00:00
node-version: ${{ matrix.node }}
2021-03-26 03:12:16 +00:00
- name: Ensure wakunode2 is ready
shell: bash
run: |
uname -a
cd nim-waku/build
./wakunode2 --help
2021-03-26 03:12:16 +00:00
2021-03-19 04:07:47 +00:00
- name: Cache npm cache
uses: actions/cache@v2
with:
path: ~/.npm
2021-04-21 03:47:28 +00:00
key: node-${{ matrix.os }}-${{ matrix.node }}-v1-${{ hashFiles('**/package-lock.json') }}
2021-03-19 04:07:47 +00:00
2021-03-15 03:50:52 +00:00
- name: install using npm ci
uses: bahmutov/npm-install@v1
- name: Generate protobuf code
2022-05-30 05:25:00 +00:00
run: |
npm run proto
npm run fix
- 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 ]
- name: build
2021-03-15 04:39:55 +00:00
run: npm run build
- name: test
env:
DEBUG: "waku:nim-waku*,waku:test*"
2021-03-15 04:39:55 +00:00
run: npm run test
2021-03-26 01:38:04 +00:00
- name: Upload logs on failure
uses: actions/upload-artifact@v2
if: failure()
with:
name: nim-waku-logs
path: log/