From f12d187727a77a900559e0a9ceeef8c3f36fc74c Mon Sep 17 00:00:00 2001 From: Avan Date: Tue, 13 Aug 2024 17:38:39 +0800 Subject: [PATCH 1/2] test: use codecov/codecov-action --- .github/workflows/main.yml | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 41b0ecf0..2097f2a7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.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 --legacy-peer-deps + 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 From 7a6489c6ac5d85f36c2b12b3516d11e703dc6d12 Mon Sep 17 00:00:00 2001 From: Avan Date: Thu, 15 Aug 2024 20:09:19 +0800 Subject: [PATCH 2/2] restore package.json --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2097f2a7..b34294fe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ jobs: key: lock-${{ github.sha }} - name: create package-lock.json - run: npm i --package-lock-only --ignore-scripts + run: npm i --package-lock-only --legacy-peer-deps - name: hack for singe file run: | @@ -38,7 +38,7 @@ jobs: - name: install if: steps.node_modules_cache_id.outputs.cache-hit != 'true' - run: npm ci + run: npm i lint: runs-on: ubuntu-latest