diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml new file mode 100644 index 0000000..725941b --- /dev/null +++ b/.github/workflows/nodejs.yml @@ -0,0 +1,43 @@ +name: Node.js CI + +on: + push: + branches: + - master + pull_request: + +env: + NODE_VERSION: 16.x + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Install dependencies + run: npm install + - name: Run ESLint + run: npm run eslint + - name: Run Prettier + run: npm run prettier + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [12.x, 14.x, 16.x] + fail-fast: false + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + - name: Install dependencies + run: npm install + - name: Run tests + run: npm run test-coverage + - name: Send coverage report to Codecov + uses: codecov/codecov-action@v2