-
Notifications
You must be signed in to change notification settings - Fork 3
84 lines (81 loc) · 2.85 KB
/
Copy pathcoverage.yml
File metadata and controls
84 lines (81 loc) · 2.85 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: C3 Coverage
on:
push:
branches:
- main
pull_request:
jobs:
# Only run coverage on Noble
coverage:
runs-on: ubuntu-latest
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
container:
image: ghcr.io/dairlab/docker-dair/noble-dair-base:v1.51.1
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
options: --cpus 4
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Install required dependencies
run: apt update && apt install -y lcov
- name: Restore coverage cache
id: c3-cov-cache-restore
uses: actions/cache/restore@v4
with:
path: ~/.cache/bazel
key: c3-bazel-cov-cache-${{ hashFiles('**/BUILD.bazel') }}
restore-keys: |
c3-bazel-cov-cache-
- name: Generate Coverage
id: generate-coverage
run: bazel coverage
--combined_report=lcov
--local_resources=ram=24000
--local_resources=cpu=4
--jobs=4
--instrument_test_targets=false
--instrumentation_filter="^//core,^//systems,^//multibody"
//core/...
//systems/...
//multibody/...
- name: Report code coverage
uses: zgosalvez/github-actions-report-lcov@v4.1.26
with:
coverage-files: bazel-out/_coverage/_coverage_report.dat
minimum-coverage: 90
artifact-name: noble-code-coverage-report
github-token: ${{ secrets.GITHUB_TOKEN }}
update-comment: true
- name: Save coverage cache
id: c3-cov-cache-save
if: always() && !cancelled() && steps.c3-cov-cache-restore.outputs.cache-hit != 'true' && steps.generate-coverage.outcome == 'success'
uses: actions/cache/save@v4
with:
key: ${{ steps.c3-cov-cache-restore.outputs.cache-primary-key }}
path: ~/.cache/bazel
- run: echo "🍏 This job's status is ${{ job.status }}."
# Deploy job [Not currently enabled]
# deploy:
# # Add a dependency to the build job
# needs: coverage
# if: ${{ github.event_name == 'push' }}
# # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
# permissions:
# pages: write # to deploy to Pages
# id-token: write # to verify the deployment originates from an appropriate source
# # Deploy to the github-pages environment
# environment:
# name: github-pages
# url: ${{ steps.deployment.outputs.page_url }}
# # Specify runner + deployment step
# runs-on: ubuntu-latest
# steps:
# - name: Deploy to GitHub Pages
# id: deployment
# uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action
# with:
# artifact_name: noble-code-coverage-report