diff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.yml index 9213d073..a052ccd8 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/nodejs.yml @@ -5,16 +5,15 @@ name: Node.js CI on: push: - branches: [ main ] + branches: [main] pull_request: - branches: [ main ] + branches: [main] permissions: pull-requests: write jobs: build: - runs-on: ubuntu-latest strategy: @@ -23,33 +22,33 @@ jobs: mongodb-version: [4.4] steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 - with: - fetch-depth: 0 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - - - name: Start MongoDB - uses: supercharge/mongodb-github-action@v1.10.0 - with: - mongodb-version: ${{ matrix.mongodb-version }} - - - name: Install dependencies - run: npm i - - - name: Test - id: test - run: | - npm run test-coverage-ci || echo "Silently ignoring coverage threshold limit..." - - - name: Upload test coverage report - uses: codecov/codecov-action@v4.1.0 - with: - files: ./coverage/lcov.info - token: ${{ secrets.CODECOV_TOKEN }} + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 + with: + fetch-depth: 0 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - name: Start MongoDB + uses: supercharge/mongodb-github-action@v1.10.0 + with: + mongodb-version: ${{ matrix.mongodb-version }} + + - name: Install dependencies + run: npm i + + - name: Test + id: test + run: | + npm run test-coverage-ci + + - name: Upload test coverage report + uses: codecov/codecov-action@v4.1.0 + with: + files: ./coverage/lcov.info + token: ${{ secrets.CODECOV_TOKEN }} # - name: Exit if coverage condition not met # if: ${{ steps.test.outputs.exit_code }} != 0 # run: exit ${{ steps.test.outputs.exit_code }} diff --git a/package.json b/package.json index 4f046ad0..98cb1974 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "server-test": "mocha --exit", "test": "mocha --exit", "test-coverage": "nyc npm run test", - "test-coverage-ci": "nyc --reporter=lcovonly --reporter=text --check-coverage npm run test", + "test-coverage-ci": "nyc --reporter=lcovonly --reporter=text npm run test", "prepare": "node ./scripts/prepare.js", "lint": "eslint \"src/**/*.{js,jsx,ts,tsx,json}\" \"test/**/*.{js,jsx,ts,tsx,json}\"", "lint:fix": "eslint --fix \"src/**/*.{js,jsx,ts,tsx,json}\" \"test/**/*.{js,jsx,ts,tsx,json}\"",