-
Notifications
You must be signed in to change notification settings - Fork 22
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
ci: enable codecov uploading again #384
Changes from 6 commits
65d651d
b6567ac
2e54ec6
dd6c05b
2691d3e
44ee5ba
a16664d
44fbcf7
e3d933a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,18 +41,19 @@ jobs: | |
with: | ||
lane: 'scan' | ||
|
||
# Read generate script file to learn more about this CI step. | ||
- name: Generate code coverage report from .xcresult/ | ||
run: ./scripts/generate-code-coverage-report.sh | ||
# https://about.codecov.io/blog/pre-converting-xcresult-files-for-codecov-using-xcresultparser/ | ||
- name: Generate code coverage report from .xcresult/ that can be converted to codecov format | ||
run: | | ||
brew tap a7ex/homebrew-formulae && brew install xcresultparser | ||
xcresultparser --output-format cobertura "Customer.io-Package.xcresult" > ".build/coverage.xml" | ||
|
||
# Disable uploading code coverage for now until we investigate the 500 errors we're getting from Codecov. | ||
# - name: Upload code coverage report | ||
# uses: codecov/codecov-action@v2 | ||
# with: | ||
# token: ${{ secrets.CODECOV_UPLOAD_TOKEN }} # not required for public repos, but sometimes uploads fail without it so include it anyway | ||
# fail_ci_if_error: true # fail if upload fails so we can catch it and fix it right away. | ||
# verbose: true | ||
# directory: .build/generated | ||
- name: Upload code coverage report | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_UPLOAD_TOKEN }} # not required for public repos, but sometimes uploads fail without it so include it anyway | ||
files: .build/coverage.xml | ||
fail_ci_if_error: true # fail if upload fails so we can catch it and fix it right away. | ||
verbose: true | ||
Comment on lines
+50
to
+56
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated action to latest v3 and modified the file path to an up-to-date one. |
||
|
||
- name: Upload test report | ||
uses: actions/upload-artifact@v3 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,11 @@ coverage: | |
informational: true | ||
project: | ||
default: | ||
informational: true | ||
informational: true | ||
|
||
# The file that contains code coverage information may contain coverage for files that we do not want to keep track of. | ||
# Example: We do not want to know the coverage for the Tests/ directory because that does not contain source code of our SDK. | ||
# https://docs.codecov.com/docs/ignoring-paths | ||
ignore: | ||
- "Tests" # ignore code coverage of Test/ files | ||
- "**/*.generated.swift" # Ignore code coverage of generated files. | ||
Comment on lines
+21
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added some ignore blocks to make our test coverage data more accurate. These files are not relevant to test coverage so we should ignore them. |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the most important part of this PR. The previous tool that we were using to convert
xcresult
file into a format that codecov understands was no longer working. So, I went out and tried to find a popular tool that we can depend on into the future.Because codecov made a blog post that included this tool, it made me feel confident in this tool.