Skip to content

Commit

Permalink
fix: add common srcs to test, check test targets only in codecov (#669)
Browse files Browse the repository at this point in the history
  • Loading branch information
miraleung committed Feb 20, 2021
1 parent e555829 commit f81ed0b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yaml
Expand Up @@ -58,6 +58,16 @@ jobs:
path: ~/.cache/bazel/*/*/*/gapic_generator_java/bazel-out/*/testlogs/*
retention-days: 5

- name: Generate Code Coverage Report
# Run only test targets, and not golden_update targets.
run: bazel coverage $(bazel query "src/test/..." | grep "Test$") --combined_report=lcov

- name: Upload Code Coverage Report
uses: codecov/codecov-action@v1
with:
name: actions ${{ matrix.java }}
files: ./bazel-out/_coverage/_coverage_report.dat

- name: Java Linter
run: bazel --batch build //:google_java_format_verification

Expand Down
Expand Up @@ -95,7 +95,7 @@ TEST_CLASS_DIR = "com.google.api.generator.gapic.composer."
name = "{0}_update".format(test_name),
srcs = [
"{0}.java".format(test_name),
],
] + COMMON_SRCS,
data = [
"//src/test/java/com/google/api/generator/gapic/composer/goldens:goldens_files",
"//src/test/java/com/google/api/generator/gapic/testdata:gapic_config_files",
Expand Down

0 comments on commit f81ed0b

Please sign in to comment.