diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a37ab9c --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/package.json b/package.json index 811b425..83df622 100644 --- a/package.json +++ b/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" } }