From 0721a2160ff48a66f1d6895e764543b956473857 Mon Sep 17 00:00:00 2001 From: Avan Date: Tue, 13 Aug 2024 17:10:53 +0800 Subject: [PATCH 1/4] test: use codecov/codecov-action --- .github/workflows/main.yml | 41 ++++++++++---------------------------- 1 file changed, 10 insertions(+), 31 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0867e1c0a..2097f2a72 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,10 +1,6 @@ name: CI -on: - push: - branches: [master] - pull_request: - branches: [master] +on: ['push', 'pull_request'] jobs: setup: @@ -24,7 +20,7 @@ jobs: key: lock-${{ github.sha }} - name: create package-lock.json - run: npm i --package-lock-only --ignore-scripts --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 ci --legacy-peer-deps + run: npm ci lint: runs-on: ubuntu-latest @@ -66,29 +63,6 @@ jobs: needs: setup - tsc: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v4 - - - name: restore cache from package-lock.json - uses: actions/cache@v4 - with: - path: package-temp-dir - key: lock-${{ github.sha }} - - - name: restore cache from node_modules - uses: actions/cache@v4 - with: - path: node_modules - key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} - - - name: tsc - run: npm run tsc - - needs: setup - compile: runs-on: ubuntu-latest steps: @@ -131,6 +105,11 @@ jobs: key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} - name: coverage - run: npm run coverage && bash <(curl -s https://codecov.io/bash) + run: npm test -- --coverage + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} needs: setup From 761bf0458d6f655af24b75bb70c12aa82f06b604 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 13 Aug 2024 22:11:36 +0800 Subject: [PATCH 2/4] Update .github/workflows/main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2097f2a72..35b289d3a 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 --ignore-scripts --legacy-peer-deps - name: hack for singe file run: | From 19fb7adb87597f9c682bd63ef588295380d22281 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 13 Aug 2024 22:13:32 +0800 Subject: [PATCH 3/4] Update main.yml --- .github/workflows/main.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 35b289d3a..91855cc2b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -63,6 +63,29 @@ jobs: needs: setup + tsc: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v4 + + - name: restore cache from package-lock.json + uses: actions/cache@v4 + with: + path: package-temp-dir + key: lock-${{ github.sha }} + + - name: restore cache from node_modules + uses: actions/cache@v4 + with: + path: node_modules + key: node_modules-${{ hashFiles('**/package-temp-dir/package-lock.json') }} + + - name: tsc + run: npm run tsc + + needs: setup + compile: runs-on: ubuntu-latest steps: From c00e0cbc2fc37a0788bfb73ff654b866df234745 Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 13 Aug 2024 22:13:40 +0800 Subject: [PATCH 4/4] Update .github/workflows/main.yml --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 91855cc2b..3e021c461 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,7 +38,7 @@ jobs: - name: install if: steps.node_modules_cache_id.outputs.cache-hit != 'true' - run: npm ci + run: npm ci --legacy-peer-deps lint: runs-on: ubuntu-latest