From 3991f811b56ed20f75025b81f2ea8f2818a1f953 Mon Sep 17 00:00:00 2001 From: Daniel Cadenas Date: Wed, 20 Dec 2023 19:05:00 -0300 Subject: [PATCH] Create node.js.yml --- .github/workflows/node.js.yml | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/node.js.yml diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..53a50f8 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,38 @@ +name: Node.js CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [14.x, 16.x, 18.x] + + steps: + - uses: actions/checkout@v3 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + - name: Install pnpm + run: npm install -g pnpm + - name: Install dependencies + run: pnpm install + - name: Run build script + run: pnpm run build --if-present + - name: Run tests + run: pnpm test + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v2 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage/lcov.info + fail_ci_if_error: true