Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Visual Coverage Test + Combined Code Coverage for Coveralls #275

Merged
merged 38 commits into from Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
ce0303f
wip
Aug 3, 2022
e884ffc
bash script
Aug 3, 2022
045154f
update merge
Aug 3, 2022
f21f56a
Automated update to THIRD-PARTY-NOTICES from github action's 3rd part…
github-actions[bot] Aug 3, 2022
1c44b90
space
Aug 3, 2022
fef4e58
remove the merge command stuff, update run_test
Aug 3, 2022
7d5ade9
use the udpated github action with coverage file param
Aug 3, 2022
594b07e
update test_script as well
Aug 3, 2022
74d37a0
for base-coverage to work, use the same script name that main branch …
Aug 3, 2022
8541580
update package json
Aug 3, 2022
c420b8d
use normal test script and lcov file in top level coverage folder for…
Aug 3, 2022
07bc6d7
revert changes in run-test github action
Aug 3, 2022
d359af3
syntax fix
Aug 3, 2022
9c01aad
add runs-on
Aug 3, 2022
e5f47d5
more syntax
Aug 3, 2022
b92ae6b
run test:visual
Aug 3, 2022
6f0bc4f
checkout repo
Aug 3, 2022
a6bef7f
install
Aug 3, 2022
128fe2d
github action test-storybook requires playwright
Aug 3, 2022
b1964a2
playwright install command
Aug 3, 2022
d88a26f
use npx instead
Aug 3, 2022
9fa48c8
cleanup
Aug 3, 2022
e40542c
curl instead of sleep
Aug 3, 2022
282f4c5
test lcov-result-merger
Aug 4, 2022
eb0c4d0
try nyc and upload to coverall
Aug 4, 2022
aea1acf
update comment
Aug 4, 2022
d5a46d2
attempt to show individual coverages
Aug 4, 2022
0053495
try uploading artifacts in first job
Aug 4, 2022
54c7a86
workflow can only be in top level of jobs, try waiting for first job
Aug 4, 2022
0617ed8
run npm test for coverage workflow
Aug 4, 2022
692e508
rename
Aug 4, 2022
c519d4e
remove test devDep
Aug 4, 2022
9c1dd62
add max attempts instead of keep curling
Aug 4, 2022
936fa7d
only collect coverage for src/components for visual test
Aug 4, 2022
2042fe6
update comments
Aug 4, 2022
ed8f0bd
reduce max attempts. remove merge-only flag
Aug 4, 2022
e1082c6
update version, kill background job before terminate
Aug 4, 2022
bddfa92
remove test stuff
Aug 4, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
46 changes: 45 additions & 1 deletion .github/workflows/coverage.yml
Expand Up @@ -9,7 +9,51 @@ on:
pull_request:

jobs:
call_code_coverage:
combined_coverage:
uses: yext/slapshot-reusable-workflows/.github/workflows/coverage.yml@v1
with:
test_script: npm run test
nmanu1 marked this conversation as resolved.
Show resolved Hide resolved
secrets:
caller_github_token: ${{ secrets.GITHUB_TOKEN }}
individual_coverage_percentages:
runs-on: ubuntu-latest
needs: combined_coverage
steps:
- uses: actions/checkout@v3
- name: Download the current coverage
uses: actions/download-artifact@v3
with:
name: coverage
path: coverage/
- name: Get Visual Coverage Percentage
uses: yext/slapshot-reusable-workflows/get-coverage-percent@v1
with:
coverage-file: coverage/visual/lcov.info
id: parse-visual-coverage
- name: Get Unit Coverage Percentage
uses: yext/slapshot-reusable-workflows/get-coverage-percent@v1
with:
coverage-file: coverage/unit/lcov.info
id: parse-unit-coverage
- name: Get Combined Coverage Percentage
uses: yext/slapshot-reusable-workflows/get-coverage-percent@v1
yen-tt marked this conversation as resolved.
Show resolved Hide resolved
with:
coverage-file: coverage/lcov.info
id: parse-combined-coverage
- name: Find Comment
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Current visual coverage
yen-tt marked this conversation as resolved.
Show resolved Hide resolved
- name: Create/Update Comment
uses: peter-evans/create-or-update-comment@v2
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
edit-mode: replace
body: |
Current unit coverage is ${{ steps.parse-unit-coverage.outputs.coverage-percent }}%
Current visual coverage is ${{ steps.parse-visual-coverage.outputs.coverage-percent }}%
Current combined coverage is ${{ steps.parse-combined-coverage.outputs.coverage-percent }}%
8 changes: 8 additions & 0 deletions .storybook/main.cjs → .storybook/main.js
Expand Up @@ -7,6 +7,14 @@ module.exports = {
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'@storybook/addon-a11y',
{
name: '@storybook/addon-coverage',
options: {
istanbul: {
include: ['src/components/**']
}
}
},
{
name: '@storybook/addon-postcss',
options: {
Expand Down
2 changes: 1 addition & 1 deletion THIRD-PARTY-NOTICES
Expand Up @@ -4,7 +4,7 @@ The following NPM packages may be included in this product:
- @babel/helper-validator-identifier@7.16.7
- @babel/highlight@7.16.10
- @babel/runtime-corejs3@7.17.2
- @babel/runtime@7.16.7
- @babel/runtime@7.18.9

These packages each contain the following license and notice below:

Expand Down