From 3f5359ec6c3dcd5b21742f7c1b7ce39a0e673e73 Mon Sep 17 00:00:00 2001 From: Fritz Lin Date: Tue, 23 Jan 2024 10:09:52 +0800 Subject: [PATCH] fix ci failed with node8 by locking nyc version https://github.com/Jayin/jsonmerge/pull/4 https://github.com/istanbuljs/nyc/issues/865 --- .github/workflows/unit-test copy.yml | 77 ---------------------------- package.json | 2 +- 2 files changed, 1 insertion(+), 78 deletions(-) delete mode 100644 .github/workflows/unit-test copy.yml diff --git a/.github/workflows/unit-test copy.yml b/.github/workflows/unit-test copy.yml deleted file mode 100644 index ab7e008..0000000 --- a/.github/workflows/unit-test copy.yml +++ /dev/null @@ -1,77 +0,0 @@ -name: unit test copy - -on: - push: - branches: [master, dev, ci/**] - pull_request: - branches: [master, dev, ci/**] - workflow_dispatch: - # Keep this to allow for triggering manually - -jobs: - unit-test: - strategy: - matrix: - node-version: - # currently devDependencies require node>=8.9 - # - 8 # skip - # - 10 # skip - # - 12 # skip - # - 14 # skip - # - 16 # skip - - 18 - os: - - windows-latest - - ubuntu-latest - - macos-latest - - runs-on: ${{ matrix.os }} - - outputs: - coverage: ${{ steps.coverage-value.outputs.coverage }} - - steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - name: Install - run: npm install - - name: Test - run: npm test - - - name: Coverage Value - id: coverage-value - if: ${{ matrix.os == 'ubuntu-latest' && matrix.node-version == 18 }} - run: | - COV=$(node -p 't=require(`./coverage/coverage-summary.json`).total,Math.min(...`lines|statements|functions|branches`.split(`|`).map(k=>t[k].pct))') - echo "coverage=$COV" >> $GITHUB_OUTPUT - - badges: - needs: [unit-test] - runs-on: ubuntu-latest - steps: - - name: Checkout gh-pages - uses: actions/checkout@v3 - with: - ref: gh-pages - - name: Use Node.js - uses: actions/setup-node@v3 - - - name: Create Badges - run: | - npm i -g badgen-cli - export COV=${{ needs.unit-test.outputs.coverage }} - COLOR=$(node -p '+process.env.COV >= 95 ? `green` : `orange`') - mkdir -p site_tmp/badges - badgen -j coverage -s $COV% -c $COLOR > site_tmp/badges/coverage.svg - - - name: Deploy Badges - run: | - cp -r site_tmp/* . - rm -rf site_tmp - - uses: stefanzweifel/git-auto-commit-action@v4 - with: - commit_message: Update badges [skip ci] - branch: gh-pages diff --git a/package.json b/package.json index 00abb06..f2f3909 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "devDependencies": { "bufferhelper": "^0.2.1", "mocha": "^2.4.5", - "nyc": "^15.1.0", + "nyc": "=15.1.0", "which": "^2.0.2" }, "dependencies": {