2021-03-15 03:42:36 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_and_test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2021-03-15 06:50:38 +00:00
|
|
|
- name: Init submodules
|
2021-03-15 07:04:17 +00:00
|
|
|
# This is done as part of pretest but as we are caching the nim binary
|
|
|
|
# which is inside the submodule, better initialising them before
|
|
|
|
# recovering the binary.
|
2021-03-15 06:50:38 +00:00
|
|
|
run: git submodule update --init --recursive
|
|
|
|
|
|
|
|
- name: Cache nim-waku binary
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ./nim-waku/build/wakunode2
|
2021-03-15 07:04:17 +00:00
|
|
|
# The nim-waku version is set by the .gitmodules file as it is a submodule
|
2021-03-15 06:50:38 +00:00
|
|
|
key: nim-waku-build-v1-${{ hashFiles('.gitmodules') }}
|
|
|
|
|
2021-03-15 03:56:06 +00:00
|
|
|
- name: Install bufbuild
|
2021-03-15 04:23:54 +00:00
|
|
|
uses: mu-io/setup-buf@v1beta
|
|
|
|
with:
|
|
|
|
buf-version: '0.39.1'
|
2021-03-15 03:56:06 +00:00
|
|
|
|
2021-03-15 04:35:42 +00:00
|
|
|
- name: Install Protoc
|
|
|
|
uses: arduino/setup-protoc@v1
|
|
|
|
with:
|
|
|
|
version: '3.x'
|
|
|
|
|
2021-03-15 03:42:36 +00:00
|
|
|
- name: Install NodeJS
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: '14'
|
|
|
|
|
2021-03-15 03:50:52 +00:00
|
|
|
- name: install using npm ci
|
|
|
|
uses: bahmutov/npm-install@v1
|
2021-03-15 03:42:36 +00:00
|
|
|
|
|
|
|
- name: build
|
2021-03-15 04:39:55 +00:00
|
|
|
run: npm run build
|
2021-03-15 03:42:36 +00:00
|
|
|
|
|
|
|
- name: test
|
2021-03-15 04:39:55 +00:00
|
|
|
run: npm run test
|