Skip to content

Commit

Permalink
Add coverage report workflow (hyperledger-caliper#1428)
Browse files Browse the repository at this point in the history
Signed-off-by: CaptainIRS <[email protected]>
Signed-off-by: eravatee <[email protected]>
  • Loading branch information
CaptainIRS authored and eravatee committed Oct 4, 2022
1 parent 85251b9 commit 470cfca
Show file tree
Hide file tree
Showing 13 changed files with 49 additions and 15 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Coverage Reports

on:
workflow_call:

jobs:
coverage:
name: Coverage Reports
runs-on: ubuntu-latest
strategy:
matrix:
package: [caliper-core, caliper-fabric, generator-caliper]
steps:
- uses: actions/checkout@v3
- name: Download coverage reports artifact
uses: actions/download-artifact@v1
with:
name: coverage-reports
path: packages
- name: Upload coverage reports
uses: codecov/[email protected]
with:
files: packages/${{ matrix.package }}/coverage/clover.xml
flags: ${{ matrix.package }}
3 changes: 3 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
unit-tests:
uses: ./.github/workflows/unit-tests.yml
needs: dci-lint
coverage:
uses: ./.github/workflows/coverage.yml
needs: unit-tests
integration-tests:
uses: ./.github/workflows/integration-tests.yml
needs: unit-tests
6 changes: 6 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,9 @@ jobs:
run: ./packages/caliper-publish/publish.js version check
- name: Run unit tests
run: npm test --workspaces
- name: Upload coverage reports artifact
if: matrix.node-version == '16.x'
uses: actions/upload-artifact@v3
with:
name: coverage-reports
path: packages/*/coverage/clover.xml
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ![Hyperledger Caliper](https://wiki.hyperledger.org/download/attachments/2392434/Hyperledger_Caliper_Logo_Color.svg?version=1&modificationDate=1548883186000&api=v2)

[![CI](https://github.com/hyperledger/caliper/actions/workflows/main.yml/badge.svg)](https://github.com/hyperledger/caliper/actions/workflows/main.yml)
[![codecov](https://codecov.io/gh/hyperledger/caliper/branch/main/graph/badge.svg?token=rVFhTNrZBJ)](https://codecov.io/gh/hyperledger/caliper)
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/2381/badge)](https://bestpractices.coreinfrastructure.org/projects/2381)
[![license](https://img.shields.io/badge/license-Apache%202.0-blue)](https://github.com/hyperledger/caliper/blob/main/LICENSE)
[![node (scoped)](https://img.shields.io/node/v/@hyperledger/caliper-cli)](https://www.npmjs.com/package/@hyperledger/caliper-cli)
Expand Down
4 changes: 2 additions & 2 deletions packages/caliper-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"licchk": "license-check-and-add",
"test": "npm run lint",
"lint": "npx eslint .",
"nyc": "nyc mocha --recursive -t 10000"
"nyc": "nyc --reporter=text --reporter=clover mocha --recursive -t 10000"
},
"engines": {
"node": ">=14.19.0",
Expand Down Expand Up @@ -89,4 +89,4 @@
"lines": 5
},
"license": "Apache-2.0"
}
}
2 changes: 1 addition & 1 deletion packages/caliper-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"licchk": "license-check-and-add",
"test": "npm run lint && npm run nyc",
"lint": "npx eslint .",
"nyc": "nyc mocha --recursive -t 10000"
"nyc": "nyc --reporter=text --reporter=clover mocha --recursive -t 10000"
},
"engines": {
"node": ">=14.19.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/caliper-ethereum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"licchk": "license-check-and-add",
"test": "npm run lint",
"lint": "npx eslint .",
"nyc": "nyc mocha --recursive -t 10000"
"nyc": "nyc --reporter=text --reporter=clover mocha --recursive -t 10000"
},
"engines": {
"node": ">=14.19.0",
Expand Down Expand Up @@ -83,4 +83,4 @@
"lines": 5
},
"license": "Apache-2.0"
}
}
2 changes: 1 addition & 1 deletion packages/caliper-fabric/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"licchk": "license-check-and-add",
"test": "npm run lint && npm run nyc",
"lint": "npx eslint .",
"nyc": "nyc mocha --recursive -t 10000"
"nyc": "nyc --reporter=text --reporter=clover mocha --recursive -t 10000"
},
"engines": {
"node": ">=14.19.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/caliper-fisco-bcos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"licchk": "license-check-and-add",
"test": "npm run lint",
"lint": "npx eslint .",
"nyc": "nyc mocha --recursive -t 10000"
"nyc": "nyc --reporter=text --reporter=clover mocha --recursive -t 10000"
},
"engines": {
"node": ">=14.19.0",
Expand Down Expand Up @@ -86,4 +86,4 @@
"lines": 5
},
"license": "Apache-2.0"
}
}
2 changes: 1 addition & 1 deletion packages/caliper-gui-dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"licchk": "license-check-and-add",
"test": "npm run lint",
"lint": "npx eslint .",
"nyc": "nyc mocha --recursive -t 10000",
"nyc": "nyc --reporter=text --reporter=clover mocha --recursive -t 10000",
"start": "SKIP_PREFLIGHT_CHECK=true react-scripts start",
"build": "react-scripts build",
"eject": "react-scripts eject",
Expand Down
4 changes: 2 additions & 2 deletions packages/caliper-gui-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"licchk": "license-check-and-add",
"test": "npm run lint",
"lint": "npx eslint .",
"nyc": "nyc mocha --recursive -t 10000",
"nyc": "nyc --reporter=text --reporter=clover mocha --recursive -t 10000",
"start": "node app.js"
},
"engines": {
Expand Down Expand Up @@ -98,4 +98,4 @@
"lines": 1
},
"license": "Apache-2.0"
}
}
4 changes: 2 additions & 2 deletions packages/caliper-publish/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"licchk": "license-check-and-add",
"test": "npm run lint",
"lint": "npx eslint .",
"nyc": "nyc mocha --recursive -t 10000"
"nyc": "nyc --reporter=text --reporter=clover mocha --recursive -t 10000"
},
"engines": {
"node": ">=14.19.0",
Expand Down Expand Up @@ -82,4 +82,4 @@
"lines": 5
},
"license": "Apache-2.0"
}
}
4 changes: 2 additions & 2 deletions packages/generator-caliper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"licchk": "license-check-and-add",
"test": "npm run lint && npm run nyc",
"lint": "npx eslint .",
"nyc": "nyc mocha --recursive -t 10000"
"nyc": "nyc --reporter=text --reporter=clover mocha --recursive -t 10000"
},
"engines": {
"node": ">=14.19.0",
Expand Down Expand Up @@ -92,4 +92,4 @@
"functions": 1,
"lines": 1
}
}
}

0 comments on commit 470cfca

Please sign in to comment.