ci: add CI
This commit is contained in:
parent
657c1806c9
commit
c311903acf
|
@ -0,0 +1,48 @@
|
|||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- "master"
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
NODE_JS: 16
|
||||
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
test:
|
||||
[
|
||||
predefined-prod,
|
||||
predefined-test,
|
||||
native-wss-prod,
|
||||
native-wss-test,
|
||||
waku-connect,
|
||||
]
|
||||
steps:
|
||||
- uses: actions/checkout@v2.3.3
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ env.NODE_JS }}
|
||||
- uses: bahmutov/npm-install@v1
|
||||
with:
|
||||
install-command: yarn
|
||||
- name: Run ${{ matrix.test }}
|
||||
run: npm run ${{ matrix.test }}
|
||||
|
||||
check:
|
||||
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
|
||||
with:
|
||||
install-command: yarn
|
||||
- run: npm run test:lint
|
||||
- run: npm run test:prettier
|
11
package.json
11
package.json
|
@ -3,9 +3,12 @@
|
|||
"packageManager": "yarn@3.2.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"lint": "eslint . --ext .js --fix",
|
||||
"format": "prettier --write .",
|
||||
"fix": "run-s lint format",
|
||||
"fix": "run-s fix:**",
|
||||
"fix:lint": "eslint . --ext .js --fix",
|
||||
"fix:prettier": "prettier --write .",
|
||||
"test": "run-s test:*",
|
||||
"test:lint": "eslint . --ext .js",
|
||||
"test:prettier": "prettier . --list-different",
|
||||
"predefined-prod": "mocha predefinedProdFleet.js --exit",
|
||||
"predefined-test": "mocha predefinedTestFleet.js --exit ",
|
||||
"native-wss-prod": "mocha nativeWssProdFleet.js --exit",
|
||||
|
@ -55,6 +58,6 @@
|
|||
},
|
||||
"lint-staged": {
|
||||
"*.js": "eslint --cache --fix",
|
||||
"*.{js,css,md}": "prettier --write"
|
||||
"*.{js,css,md,yml}": "prettier --write"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue