Skip to content

Commit f6f90d3

Browse files
Create action to generate code coverage (#4796)
This is a first stab at generating a github action to generate code coverage reports.
1 parent 8f279ba commit f6f90d3

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Generate a coverage report and publish it to GitHub pages
2+
3+
on:
4+
# Runs on pushes targeting the default branch
5+
push:
6+
branches: ["main"]
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow one concurrent deployment
18+
concurrency:
19+
group: "pages"
20+
cancel-in-progress: true
21+
22+
jobs:
23+
# Build job
24+
build:
25+
runs-on: ubuntu-latest
26+
timeout-minutes: 240
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v3
30+
- name: Setup Pages
31+
uses: actions/configure-pages@v2
32+
- name: Configure
33+
run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DDXC_COVERAGE=On -C ${{github.workspace}}/cmake/caches/PredefinedParams -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ${{github.workspace}}
34+
- name: Build
35+
run: cd build && make
36+
- name: Test
37+
run: cd build && ctest
38+
- name: Generate Report
39+
run: cd build && make generate-coverage-report
40+
- name: Upload artifact
41+
uses: actions/upload-pages-artifact@v1
42+
with:
43+
path: ${{github.workspace}}/build/report
44+
45+
46+
# Deployment job
47+
deploy:
48+
environment:
49+
name: github-pages
50+
url: ${{ steps.deployment.outputs.page_url }}
51+
runs-on: ubuntu-latest
52+
needs: build
53+
steps:
54+
- name: Deploy to GitHub Pages
55+
id: deployment
56+
uses: actions/deploy-pages@v1

0 commit comments

Comments
 (0)