Skip to content

Commit

Permalink
Add coverage report workflow
Browse files Browse the repository at this point in the history
Signed-off-by: CaptainIRS <[email protected]>
  • Loading branch information
CaptainIRS committed Aug 5, 2022
1 parent c648fa9 commit b51445d
Show file tree
Hide file tree
Showing 12 changed files with 48 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
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 b51445d

Please sign in to comment.