mirror of https://github.com/waku-org/js-waku.git
Merge pull request #898 from status-im/ci/split-tests
This commit is contained in:
commit
3635b43c01
|
@ -9,48 +9,45 @@ on:
|
|||
pull_request:
|
||||
|
||||
env:
|
||||
BUF_VERSION: "0.56.0"
|
||||
NIM_WAKU_VERSION: "v0.9"
|
||||
NODE_JS: "16"
|
||||
|
||||
jobs:
|
||||
build_and_test:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
check:
|
||||
runs-on: ubuntu-latest
|
||||
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
|
||||
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
|
||||
|
||||
- name: Install NodeJS
|
||||
uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ env.NODE_JS }}
|
||||
- uses: bahmutov/npm-install@v1
|
||||
- run: npm run test:lint
|
||||
- run: npm run test:prettier
|
||||
- run: npm run test:spelling
|
||||
- run: npm run test:tsc
|
||||
|
||||
- name: Ensure wakunode2 is ready
|
||||
shell: bash
|
||||
run: |
|
||||
uname -a
|
||||
cd nim-waku/build
|
||||
./wakunode2 --help
|
||||
|
||||
- name: install using npm ci
|
||||
uses: bahmutov/npm-install@v1
|
||||
build:
|
||||
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
|
||||
|
||||
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
|
||||
run: |
|
||||
npm run proto
|
||||
npm run fix
|
||||
|
||||
- name: Check all protobuf code was committed
|
||||
shell: bash
|
||||
run: |
|
||||
|
@ -58,13 +55,40 @@ jobs:
|
|||
echo -n "'$res'" # For debug purposes
|
||||
[ $(echo -n "$res"|wc -l) -eq 0 ]
|
||||
|
||||
- name: build
|
||||
run: npm run build
|
||||
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
|
||||
- run: npm run test:browser
|
||||
|
||||
- name: test
|
||||
node:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Get nim-waku
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p nim-waku/build
|
||||
cd nim-waku
|
||||
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
|
||||
- name: Ensure wakunode2 is ready
|
||||
shell: bash
|
||||
run: |
|
||||
uname -a
|
||||
cd nim-waku/build
|
||||
./wakunode2 --help
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ env.NODE_JS }}
|
||||
- uses: bahmutov/npm-install@v1
|
||||
- run: npm run test:node
|
||||
env:
|
||||
DEBUG: "waku:nim-waku*,waku:test*"
|
||||
run: npm run test
|
||||
|
||||
- name: Upload logs on failure
|
||||
uses: actions/upload-artifact@v2
|
||||
|
@ -76,18 +100,13 @@ jobs:
|
|||
release_next:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
||||
needs: [build_and_test]
|
||||
needs: [check, build, proto, browser, node]
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2.3.3
|
||||
|
||||
- name: Install NodeJS
|
||||
uses: actions/setup-node@v3
|
||||
- uses: actions/checkout@v2.3.3
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ env.NODE_JS }}
|
||||
|
||||
- name: install using npm ci
|
||||
uses: bahmutov/npm-install@v1
|
||||
- uses: bahmutov/npm-install@v1
|
||||
|
||||
- name: Append git hash to version
|
||||
shell: bash
|
||||
|
@ -100,5 +119,4 @@ jobs:
|
|||
- name: Authenticate with registry
|
||||
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ./.npmrc
|
||||
|
||||
- name: publish
|
||||
run: npm publish --tag next --access public
|
||||
- run: npm publish --tag next --access public
|
||||
|
|
Loading…
Reference in New Issue