2021-03-15 14:42:36 +11:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
2021-03-23 10:33:11 +11:00
|
|
|
- 'staging'
|
|
|
|
- 'trying'
|
2021-03-15 14:42:36 +11:00
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_and_test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
2021-03-19 11:36:33 +11:00
|
|
|
with:
|
|
|
|
submodules: 'recursive'
|
2021-03-15 14:42:36 +11:00
|
|
|
|
2021-03-19 10:31:26 +11:00
|
|
|
- name: Get nim-waku HEAD
|
|
|
|
id: nim-waku-head
|
|
|
|
shell: bash
|
2021-03-19 11:36:33 +11:00
|
|
|
run: cd nim-waku && echo "::set-output name=ref::$(git rev-parse HEAD)"
|
2021-03-19 10:31:26 +11:00
|
|
|
|
2021-03-15 17:50:38 +11:00
|
|
|
- name: Cache nim-waku binary
|
2021-03-19 15:16:50 +11:00
|
|
|
id: cache-nim-waku
|
2021-03-15 17:50:38 +11:00
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
2021-03-15 18:20:30 +11:00
|
|
|
path: |
|
|
|
|
./nim-waku/build/wakunode2
|
|
|
|
./nim-waku/vendor/rln/target/debug
|
2021-03-25 20:10:27 +11:00
|
|
|
key: nim-waku-build-v3-${{ steps.nim-waku-head.outputs.ref }}
|
2021-03-15 17:50:38 +11:00
|
|
|
|
2021-03-19 15:16:50 +11:00
|
|
|
# This would have been done part of npm pretest but it gives better
|
|
|
|
# visibility in the CI if done as a separate step
|
|
|
|
- name: Build wakunode2
|
|
|
|
shell: bash
|
2021-03-26 14:35:18 +11:00
|
|
|
run: cd nim-waku && ./build/wakunode2 --help || make wakunode2
|
2021-03-19 15:16:50 +11:00
|
|
|
|
2021-03-26 14:12:16 +11:00
|
|
|
- name: Ensure wakunode2 is ready
|
|
|
|
shell: bash
|
|
|
|
run: cd nim-waku && ./build/wakunode2 --help
|
|
|
|
|
2021-03-15 14:56:06 +11:00
|
|
|
- name: Install bufbuild
|
2021-03-15 15:23:54 +11:00
|
|
|
uses: mu-io/setup-buf@v1beta
|
|
|
|
with:
|
|
|
|
buf-version: '0.39.1'
|
2021-03-15 14:56:06 +11:00
|
|
|
|
2021-03-15 15:35:42 +11:00
|
|
|
- name: Install Protoc
|
|
|
|
uses: arduino/setup-protoc@v1
|
|
|
|
with:
|
|
|
|
version: '3.x'
|
|
|
|
|
2021-03-15 14:42:36 +11:00
|
|
|
- name: Install NodeJS
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: '14'
|
|
|
|
|
2021-03-19 15:07:47 +11:00
|
|
|
- name: Cache npm cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
with:
|
|
|
|
path: ~/.npm
|
|
|
|
key: node-v1-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
|
2021-03-15 14:50:52 +11:00
|
|
|
- name: install using npm ci
|
|
|
|
uses: bahmutov/npm-install@v1
|
2021-03-15 14:42:36 +11:00
|
|
|
|
|
|
|
- name: build
|
2021-03-15 15:39:55 +11:00
|
|
|
run: npm run build
|
2021-03-15 14:42:36 +11:00
|
|
|
|
|
|
|
- name: test
|
2021-03-15 15:39:55 +11:00
|
|
|
run: npm run test
|
2021-03-26 12:38:04 +11:00
|
|
|
|
|
|
|
- name: Upload logs on failure
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: nim-waku-logs
|
|
|
|
path: log/
|