Merge pull request #898 from status-im/ci/split-tests

This commit is contained in:
fryorcraken.eth 2022-08-19 23:49:28 +10:00 committed by GitHub
commit 3635b43c01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 67 additions and 45 deletions

View File

@ -9,48 +9,45 @@ on:
pull_request: pull_request:
env: env:
BUF_VERSION: "0.56.0"
NIM_WAKU_VERSION: "v0.9" NIM_WAKU_VERSION: "v0.9"
NODE_JS: "16" NODE_JS: "16"
jobs: jobs:
build_and_test: check:
strategy: runs-on: ubuntu-latest
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps: steps:
- name: Checkout code - uses: actions/checkout@v3
uses: actions/checkout@v2.3.3 - uses: actions/setup-node@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: Install NodeJS
uses: actions/setup-node@v3
with: with:
node-version: ${{ env.NODE_JS }} 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 build:
shell: bash runs-on: ubuntu-latest
run: | steps:
uname -a - uses: actions/checkout@v3
cd nim-waku/build - uses: actions/setup-node@v3
./wakunode2 --help with:
node-version: ${{ env.NODE_JS }}
- name: install using npm ci - uses: bahmutov/npm-install@v1
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 - name: Generate protobuf code
run: | run: |
npm run proto npm run proto
npm run fix npm run fix
- name: Check all protobuf code was committed - name: Check all protobuf code was committed
shell: bash shell: bash
run: | run: |
@ -58,13 +55,40 @@ jobs:
echo -n "'$res'" # For debug purposes echo -n "'$res'" # For debug purposes
[ $(echo -n "$res"|wc -l) -eq 0 ] [ $(echo -n "$res"|wc -l) -eq 0 ]
- name: build browser:
run: npm run 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 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: env:
DEBUG: "waku:nim-waku*,waku:test*" DEBUG: "waku:nim-waku*,waku:test*"
run: npm run test
- name: Upload logs on failure - name: Upload logs on failure
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v2
@ -76,18 +100,13 @@ jobs:
release_next: release_next:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master' if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: [build_and_test] needs: [check, build, proto, browser, node]
steps: steps:
- name: Checkout code - uses: actions/checkout@v2.3.3
uses: actions/checkout@v2.3.3 - uses: actions/setup-node@v3
- name: Install NodeJS
uses: actions/setup-node@v3
with: with:
node-version: ${{ env.NODE_JS }} node-version: ${{ env.NODE_JS }}
- uses: bahmutov/npm-install@v1
- name: install using npm ci
uses: bahmutov/npm-install@v1
- name: Append git hash to version - name: Append git hash to version
shell: bash shell: bash
@ -100,5 +119,4 @@ jobs:
- name: Authenticate with registry - name: Authenticate with registry
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ./.npmrc 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

View File

@ -1,5 +1,9 @@
status = [ status = [
"build_and_test (ubuntu-latest)", "check",
"build",
"proto",
"browser",
"node",
"examples_build_and_test (eth-pm)", "examples_build_and_test (eth-pm)",
"examples_build_and_test (eth-pm-wallet-encryption)", "examples_build_and_test (eth-pm-wallet-encryption)",
"examples_build_and_test (relay-angular-chat)", "examples_build_and_test (relay-angular-chat)",