Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/apply_outside_tool.yml
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"
Comment on lines +15 to +19
Copy link
Copy Markdown
Owner Author

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.

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
6 changes: 6 additions & 0 deletions post_coverage/test.rb
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")