From 3332d2844a972d6420cf72c0d9d2af128e554f77 Mon Sep 17 00:00:00 2001 From: Avan Date: Tue, 13 Aug 2024 17:36:29 +0800 Subject: [PATCH] test: use codecov/codecov-action --- .github/workflows/react-component-ci.yml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/react-component-ci.yml b/.github/workflows/react-component-ci.yml index a60eecd..2097f2a 100644 --- a/.github/workflows/react-component-ci.yml +++ b/.github/workflows/react-component-ci.yml @@ -1,17 +1,13 @@ name: CI -on: - push: - branches: [master] - pull_request: - branches: [master] +on: ['push', 'pull_request'] jobs: setup: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@master + uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: @@ -24,7 +20,7 @@ jobs: key: lock-${{ github.sha }} - name: create package-lock.json - run: npm i --package-lock-only + run: npm i --package-lock-only --ignore-scripts - name: hack for singe file run: | @@ -32,6 +28,7 @@ jobs: mkdir package-temp-dir fi cp package-lock.json package-temp-dir + - name: cache node_modules id: node_modules_cache_id uses: actions/cache@v4 @@ -41,7 +38,7 @@ jobs: - name: install if: steps.node_modules_cache_id.outputs.cache-hit != 'true' - run: npm i + run: npm ci lint: runs-on: ubuntu-latest @@ -110,9 +107,9 @@ jobs: - name: coverage run: npm test -- --coverage - - uses: codecov/codecov-action@v4 + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 with: - fail_ci_if_error: true # optional (default = false) - token: ${{ secrets.CODECOV_TOKEN }} # required + token: ${{ secrets.CODECOV_TOKEN }} needs: setup