From 17fe3d948bcf7d72b438c7ed8f8947f35778d8dc Mon Sep 17 00:00:00 2001 From: summerji Date: Wed, 17 Feb 2021 14:26:04 -0800 Subject: [PATCH 01/11] Add codecov config file and add codecov github action --- .github/workflows/ci.yaml | 4 ++++ codecov.yml | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 codecov.yml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 43550ffde1..d33f7c12d3 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -60,6 +60,10 @@ jobs: name: artifacts path: ~/artifacts + - name: Tests Coverage + uses: actions/codecov-action@v1 + + license-header: runs-on: ubuntu-latest steps: diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000000..20a9e14394 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,18 @@ +codecov: + notify: + require_ci_to_pass: yes + + coverage: + precision: 2 + round: down + range: 70...100 + + status: + # Learn more at https://codecov.io/docs#yaml_default_commit_status + project: true + patch: true + changes: false + + comment: + layout: "header, diff, uncovered" + behavior: default # update if exists else create new \ No newline at end of file From 9fe31625c1318c3961b9a91094a956c9c9f5bc6b Mon Sep 17 00:00:00 2001 From: summerji Date: Wed, 17 Feb 2021 14:28:49 -0800 Subject: [PATCH 02/11] add name in github action --- .github/workflows/ci.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d33f7c12d3..7dadbad857 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -62,7 +62,8 @@ jobs: - name: Tests Coverage uses: actions/codecov-action@v1 - + with: + name: actions ${{ matrix.java }} license-header: runs-on: ubuntu-latest From d2793ac1e74af8e1ef5ef081f99463ca3907c73f Mon Sep 17 00:00:00 2001 From: summerji Date: Wed, 17 Feb 2021 14:45:16 -0800 Subject: [PATCH 03/11] Add codecov badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 5c397090a9..81e7a60189 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![codecov](https://codecov.io/gh/googleapis/gapic-generator-java/branch/master/graph/badge.svg?token=3RUU37GX9U)](https://codecov.io/gh/googleapis/gapic-generator-java) # API Client Generator for Java A generator for protocol buffer described APIs for and in Java. From 087b008063694f6925c11af6fe4cee311b3c9a10 Mon Sep 17 00:00:00 2001 From: summerji Date: Wed, 17 Feb 2021 14:48:13 -0800 Subject: [PATCH 04/11] typo on action name --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 7dadbad857..f90549a35c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -61,7 +61,7 @@ jobs: path: ~/artifacts - name: Tests Coverage - uses: actions/codecov-action@v1 + uses: codecov/codecov-action@v1 with: name: actions ${{ matrix.java }} From 4fb7448e0e74c342608d9e1f19fdc9995617a4d0 Mon Sep 17 00:00:00 2001 From: summerji Date: Wed, 17 Feb 2021 21:02:58 -0800 Subject: [PATCH 05/11] Add coverage report files --- .github/workflows/ci.yaml | 6 +++++- codecov.yml | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f90549a35c..3568d35483 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -60,10 +60,14 @@ jobs: name: artifacts path: ~/artifacts - - name: Tests Coverage + - name: Generate Code Coverage Report + run: bazel coverage //src/test/... --combined_report=lcov + + - name: Code Coverage uses: codecov/codecov-action@v1 with: name: actions ${{ matrix.java }} + files: ./bazel-out/_coverage_report.dat license-header: runs-on: ubuntu-latest diff --git a/codecov.yml b/codecov.yml index 20a9e14394..6508e14940 100644 --- a/codecov.yml +++ b/codecov.yml @@ -8,9 +8,12 @@ codecov: range: 70...100 status: - # Learn more at https://codecov.io/docs#yaml_default_commit_status project: true + default: + informational: true patch: true + default: + informatioanl: true changes: false comment: From 31e3f75847dc3937904c47f0c28d170e28d014b0 Mon Sep 17 00:00:00 2001 From: summerji Date: Wed, 17 Feb 2021 21:17:43 -0800 Subject: [PATCH 06/11] fix directory --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3568d35483..db9a2fec19 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -67,7 +67,7 @@ jobs: uses: codecov/codecov-action@v1 with: name: actions ${{ matrix.java }} - files: ./bazel-out/_coverage_report.dat + files: ./bazel-out/_coverage/_coverage_report.dat license-header: runs-on: ubuntu-latest From 9e95ba2151e69c928f5fec5ea25b4c645877bf48 Mon Sep 17 00:00:00 2001 From: summerji Date: Wed, 17 Feb 2021 21:37:30 -0800 Subject: [PATCH 07/11] Remove generating test report --- .github/workflows/ci.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index db9a2fec19..2ab12ec99b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -60,9 +60,6 @@ jobs: name: artifacts path: ~/artifacts - - name: Generate Code Coverage Report - run: bazel coverage //src/test/... --combined_report=lcov - - name: Code Coverage uses: codecov/codecov-action@v1 with: From 22ee9d2152983963643ccf5481990c672ad8d2cf Mon Sep 17 00:00:00 2001 From: summerji Date: Wed, 17 Feb 2021 21:45:43 -0800 Subject: [PATCH 08/11] missing report --- .github/workflows/ci.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2ab12ec99b..9fa3f2216d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -61,6 +61,7 @@ jobs: path: ~/artifacts - name: Code Coverage + run: bazel coverage //src/test/... --combined_report=lcov uses: codecov/codecov-action@v1 with: name: actions ${{ matrix.java }} From 4670d693300ce13854afea7b6b29aa5a53bb84cf Mon Sep 17 00:00:00 2001 From: summerji Date: Wed, 17 Feb 2021 22:34:37 -0800 Subject: [PATCH 09/11] split step --- .github/workflows/ci.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9fa3f2216d..db9a2fec19 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -60,8 +60,10 @@ jobs: name: artifacts path: ~/artifacts - - name: Code Coverage + - name: Generate Code Coverage Report run: bazel coverage //src/test/... --combined_report=lcov + + - name: Code Coverage uses: codecov/codecov-action@v1 with: name: actions ${{ matrix.java }} From c5c8a8d8327e7c749f4e01ecf96bd6e4d7de0721 Mon Sep 17 00:00:00 2001 From: summerji Date: Thu, 18 Feb 2021 10:07:26 -0800 Subject: [PATCH 10/11] try fix Issue detecting commit SHA. Please run actions/checkout with fetch-depth > 1 or set to 0 --- .github/workflows/ci.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index db9a2fec19..bb452e43a6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,6 +18,8 @@ jobs: java: [8, 11] steps: - uses: actions/checkout@v2 + with: + fetch-depth:1 - uses: actions/setup-java@v1 with: java-version: ${{ matrix.java }} @@ -63,7 +65,7 @@ jobs: - name: Generate Code Coverage Report run: bazel coverage //src/test/... --combined_report=lcov - - name: Code Coverage + - name: Upload Code Coverage Report uses: codecov/codecov-action@v1 with: name: actions ${{ matrix.java }} From 74e2543cacb2ce2fe175476ed7df6b4f485d2759 Mon Sep 17 00:00:00 2001 From: summerji Date: Thu, 18 Feb 2021 10:10:29 -0800 Subject: [PATCH 11/11] miss space --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index bb452e43a6..cd20081396 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - fetch-depth:1 + fetch-depth: 1 - uses: actions/setup-java@v1 with: java-version: ${{ matrix.java }}