Skip to content

Commit

Permalink
chore: coverage reporting
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Gammon <sam@elide.ventures>
  • Loading branch information
sgammon committed Aug 22, 2023
1 parent 70e5360 commit af86790
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 10 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/module.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ name: "Build"
type: boolean
default: false

## Whether we should report coverage
coverage:
description: "Coverage"
type: boolean
default: false

## Bazel version to use
bazel_version:
description: "Bazel version"
Expand Down Expand Up @@ -84,6 +90,11 @@ name: "Build"
description: "Flags"
type: string
default: ""
coverage:
description: "Coverage"
type: boolean
default: false

secrets:
## Secrets: BuildBuddy API key
BUILDBUDDY_APIKEY:
Expand All @@ -93,6 +104,10 @@ name: "Build"
BUILDLESS_APIKEY:
required: false

## Secrets: Codecov Reporting Token
CODECOV_TOKEN:
required: false

env:
BUILDLESS_APIKEY: ${{ secrets.BUILDLESS_APIKEY }}
BUILDBUDDY_APIKEY: ${{ secrets.BUILDBUDDY_APIKEY }}
Expand Down Expand Up @@ -133,6 +148,19 @@ jobs:
continue-on-error: ${{ inputs.labs }}
shell: bash
run: bazel build --config=ci ${{ inputs.flags }} "//example/native"
- name: "Testsuite"
continue-on-error: ${{ inputs.labs }}
shell: bash
run: bazel coverage --config=ci ${{ inputs.flags }} "//tools/..." "//tests/..." "//.aspect/..."
- name: "Report: Coverage"
uses: codecov/codecov-action@v3
if: inputs.coverage
continue-on-error: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: bazel-out/_coverage/_coverage_report.dat
flags: tools
fail_ci_if_error: true # optional (default = false)

integration-tests:
name: ${{ matrix.label }}
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/on.pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,26 @@ jobs:
labs: [false]
flags: ["--config=linux"]
testlabel: ["Ubuntu"]
coverage: [false]
include:
# Bazel 7
- runner: ubuntu-latest
label: Ubuntu
labs: false
main: true
coverage: true
flags: --config=linux
- runner: macos-latest
label: macOS
labs: false
main: true
coverage: false
flags: --config=mac
- runner: windows-2022
label: Windows
labs: false
main: true
coverage: false
flags: --config=windows

secrets: inherit
Expand All @@ -92,3 +96,4 @@ jobs:
labs: ${{ matrix.labs }}
main: ${{ matrix.main }}
flags: ${{ matrix.flags }}
coverage: ${{ matrix.coverage }}
34 changes: 24 additions & 10 deletions .github/workflows/on.push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,39 @@ jobs:
strategy:
fail-fast: false
matrix:
runner: [ubuntu-latest, windows-latest, macos-latest]
runner: [ubuntu-latest]
main: [true]
label: ["Ubuntu"]
labs: [false]
flags: ["--config=linux"]
testlabel: ["Ubuntu"]
coverage: [false]
include:
# Bazel 7
- runner: ubuntu-latest
label: Ubuntu - Standard
bzlmod: true
labs: false
- runner: ubuntu-latest
label: Ubuntu - Bzlmod
bzlmod: true
label: Ubuntu
labs: false
main: true
coverage: true
flags: --config=linux
- runner: macos-latest
label: macOS
bzlmod: false
labs: false
main: true
coverage: false
flags: --config=mac
- runner: windows-2022
label: Windows
labs: false
main: true
coverage: false
flags: --config=windows

secrets: inherit
with:
runner: ${{ matrix.runner }}
label: ${{ matrix.label }}
bzlmod: ${{ matrix.bzlmod }}
labs: ${{ matrix.labs }}
tests: true
main: ${{ matrix.main }}
flags: ${{ matrix.flags }}
coverage: ${{ matrix.coverage }}

0 comments on commit af86790

Please sign in to comment.