forked from envoyproxy/envoy-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (51 loc) · 1.76 KB
/
coverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: coverage
on:
push:
branches:
- main
pull_request:
jobs:
coverage:
name: coverage
runs-on: ubuntu-latest
timeout-minutes: 120
defaults:
run:
shell: bash
container:
image: envoyproxy/envoy-build-ubuntu:0a02a76af5951bf7f4c7029c0ea6d29d96c0f682
steps:
- uses: actions/checkout@v1
with:
submodules: true
- name: Add safe directory
run: git config --global --add safe.directory /__w/envoy-mobile/envoy-mobile
- id: check_context
name: 'Check whether to run'
run: |
if git rev-parse --abbrev-ref HEAD | grep -q ^main$ || git diff --name-only origin/main | grep -qe common/ -e ^.github/workflows/coverage.yml ; then
echo "Coverage will run."
echo "run_coverage=true" >> $GITHUB_OUTPUT
else
echo "Skipping coverage."
echo "run_coverage=false" >> $GITHUB_OUTPUT
fi
- name: 'Run coverage'
if: steps.check_context.outputs.run_coverage == 'true'
continue-on-error: true
run: |
echo "build --remote_header=\"Authorization=Bearer ${{ secrets.GITHUB_TOKEN }}\"" > ~/.bazelrc
BAZEL_BUILD_OPTIONS="--config=remote-ci-linux-coverage" \
PATH=/opt/llvm/bin:${PATH} \
COVERAGE_THRESHOLD=95 \
./envoy/test/run_envoy_bazel_coverage.sh //test/common/...
- name: 'Package coverage'
if: steps.check_context.outputs.run_coverage == 'true'
run: |
tar -czvf coverage.tar.gz generated/coverage
- name: 'Upload report'
if: steps.check_context.outputs.run_coverage == 'true'
uses: actions/upload-artifact@v2
with:
name: coverage.tar.gz
path: coverage.tar.gz