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

133 lines
3.5 KiB
YAML
Raw Normal View History

name: CI
on:
push:
branches:
2022-05-02 06:32:56 +00:00
- "master"
- "staging"
- "trying"
pull_request:
workflow_dispatch:
inputs:
nim_wakunode_image:
description: "Docker hub image name taken from https://hub.docker.com/r/wakuorg/nwaku/tags. Format: wakuorg/nwaku:v0.20.0"
required: false
type: string
env:
NODE_JS: "18"
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
with:
repository: waku-org/js-waku
2022-08-19 13:26:31 +00:00
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_JS }}
- 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
2022-08-19 13:26:31 +00:00
proto:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: waku-org/js-waku
2022-08-19 13:26:31 +00:00
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_JS }}
- uses: ./.github/actions/npm
- 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 ]
2022-08-19 13:26:31 +00:00
browser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: waku-org/js-waku
2022-08-19 13:26:31 +00:00
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_JS }}
- uses: ./.github/actions/npm
- run: npx playwright install --with-deps
- run: npm run build:esm
2022-08-19 13:26:31 +00:00
- run: npm run test:browser
2022-08-19 13:26:31 +00:00
node:
2023-09-13 08:12:01 +00:00
uses: ./.github/workflows/test-node.yml
secrets: inherit
2023-09-12 12:28:46 +00:00
with:
nim_wakunode_image: ${{ inputs.nim_wakunode_image || 'wakuorg/nwaku:v0.21.0' }}
2023-09-12 14:33:34 +00:00
test_type: node
allure_reports: true
2022-08-19 09:22:35 +00:00
node_optional:
2023-09-13 08:12:01 +00:00
uses: ./.github/workflows/test-node.yml
2023-09-12 14:33:34 +00:00
with:
nim_wakunode_image: ${{ inputs.nim_wakunode_image || 'wakuorg/nwaku:v0.21.0' }}
2023-09-12 14:33:34 +00:00
test_type: node-optional
node_with_go_waku_master:
2023-09-13 08:12:01 +00:00
uses: ./.github/workflows/test-node.yml
2023-09-12 14:33:34 +00:00
with:
nim_wakunode_image: wakuorg/go-waku:latest
2023-09-12 14:59:31 +00:00
test_type: go-waku-master
2023-10-30 13:46:03 +00:00
debug: waku*
node_with_nwaku_master:
2023-09-13 08:12:01 +00:00
uses: ./.github/workflows/test-node.yml
2023-09-12 14:33:34 +00:00
with:
nim_wakunode_image: wakuorg/nwaku:deploy-wakuv2-test
2023-09-12 14:59:31 +00:00
test_type: nwaku-master
2023-10-30 13:46:03 +00:00
debug: waku*
maybe-release:
name: release
runs-on: ubuntu-latest
2023-09-12 12:28:46 +00:00
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
token: ${{ secrets.CI_TOKEN }}
- uses: actions/checkout@v3
with:
repository: waku-org/js-waku
if: ${{ steps.release.outputs.releases_created }}
- uses: actions/setup-node@v3
if: ${{ steps.release.outputs.releases_created }}
with:
node-version: ${{ env.NODE_JS }}
registry-url: "https://registry.npmjs.org"
- run: npm install
if: ${{ steps.release.outputs.releases_created }}
- run: npm run build
if: ${{ steps.release.outputs.releases_created }}
- run: npm run publish
if: ${{ steps.release.outputs.releases_created }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_JS_WAKU_PUBLISH }}