-
Notifications
You must be signed in to change notification settings - Fork 1
Add code coverage workflow. #98
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
Open
granluo
wants to merge
12
commits into
main
Choose a base branch
from
add_testing_workflow
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
924f429
Add code coverage workflow.
granluo 9a83801
Add code coverage workflow.
granluo d927aa7
Add code coverage workflow.
granluo 6d432ab
Add code coverage workflow.
granluo 492cdf5
Add code coverage workflow.
granluo 0d91b81
Add code coverage workflow.
granluo f32efb7
Add code coverage workflow.
granluo e87f536
Add code coverage workflow.
granluo 4d9f4ee
Add code coverage workflow.
granluo 30ef35b
Add code coverage workflow.
granluo e35ac3d
Test.
granluo d209f80
Test new pull request.
granluo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| name: test_coverage_with_external_tool | ||
|
|
||
| on: | ||
| pull_request: | ||
| # open will be triggered when a pull request is created. | ||
| # synchronize will be triggered when a pull request has new commits. | ||
| # closed will be triggered when a pull request is closed. | ||
| types: [opened, synchronize, closed] | ||
|
|
||
| jobs: | ||
| setup: | ||
| outputs: | ||
| base_commit: ${{ steps.get_base_commit.outputs.base_commit }} | ||
| runs-on: macOS-latest | ||
| steps: | ||
| - name: Checkout tools | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| repository: "firebase/firebase-ios-sdk" | ||
| path: "tool" | ||
| - name: Build tool | ||
| run: | | ||
| cd tool/scripts/code_coverage_report/generate_code_coverage_report | ||
| swift build | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| path: "main" | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Get Diff | ||
| id: get_base_commit | ||
| env: | ||
| pr_branch: ${{ github.event.pull_request.head.ref }} | ||
| run: | | ||
| ls | ||
| cd main | ||
| git branch -la | ||
| common_commit=$(git merge-base remotes/origin/${pr_branch} remotes/origin/main) | ||
| echo "The common commit is ${common_commit}." | ||
| # Set base commit and this will be used to compare diffs of coverage to the current commit. | ||
| echo "::set-output name=base_commit::${common_commit}" | ||
| git diff --name-only $common_commit remotes/origin/${pr_branch} > updated_files.txt | ||
| cat updated_files.txt | ||
| ../tool/scripts/code_coverage_report/generate_code_coverage_report/.build/debug/CoverageReportGenerator | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| require 'octokit' | ||
|
|
||
| client = Octokit::Client.new(access_token: ENV["INPUT_ACCESS_TOKEN"]) | ||
| #client.add_comment(REPO_NAME_WITH_OWNER, last_issue.number, NO_WORKFLOW_RUNNING_INFO) | ||
| client.create_pull_request_comment("granluo/issue_generations",98,"testing","e35ac3de3cf8c0f5ec95736cd7566a1f144afe18","post_coverage/test.rb",4, {:side=>"RIGHT", :start_line=> 3, :line=> 5}) | ||
| print ("asdf") |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Incremental code coverage report
Tests for New code lines are not detected in Test-FirebaseDatabase-Unit-unit-2021.05.06_01-22-03--0700, please add tests on highlighted lines.