Skip to content

Commit 1e85d0b

Browse files
committed
Add workflow job to generate a coverage report.
URI is https://gnucash.github.io/
1 parent 6834cb5 commit 1e85d0b

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

.github/workflows/coverage.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: coverage
2+
on: push
3+
permissions: {}
4+
jobs:
5+
coverage:
6+
runs-on: ubuntu-latest
7+
name: C++ Code coverage analysis
8+
continue-on-error: true
9+
env:
10+
TZ: America/Los_Angeles
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
- run: sudo apt-get update
15+
- name: Install additional dependencies
16+
run: sudo apt-get install -y gettext cmake libxslt-dev xsltproc ninja-build libboost-all-dev libgtk-3-dev guile-2.2-dev libgwengui-gtk3-dev libaqbanking-dev libofx-dev libdbi-dev libdbd-sqlite3 libwebkit2gtk-4.0-dev googletest lcov
17+
- name: Install language packs.
18+
run: sudo apt-get --reinstall install -y language-pack-en language-pack-fr
19+
- run: |
20+
echo "ROOT_DIR=$GITHUB_WORKSPACE/.." >> $GITHUB_ENV
21+
- name: Create Directories
22+
run: |
23+
pwd
24+
mkdir $ROOT_DIR/inst
25+
mkdir build
26+
- name: Configure GnuCash
27+
run: |
28+
cd build
29+
cmake -G Ninja -DWITH_PYTHON=ON -DCMAKE_INSTALL_PREFIX=$ROOT_DIR/inst $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DCOVERAGE=ON
30+
- name: Build and test GnuCash with coverage analysis
31+
run: |
32+
cd build
33+
ninja
34+
ninja lcov-initialize
35+
ninja check
36+
ninja -k 0 lcov-collect
37+
ninja lcov-generate-html
38+
env:
39+
CTEST_OUTPUT_ON_FAILURE: Off
40+
- name: prepare_upload
41+
if: success()
42+
run: |
43+
mkdir build/github-pages
44+
mv build/Coverage-HTML build/github-pages/
45+
chmod -v -R +rX "build/github-pages" | while read line; do
46+
echo "::warning title=Invalid file permissions automatically fixed::$line"
47+
done
48+
- name: Upload pages
49+
uses: actions/upload-pages-artifact@v2
50+
if: success()
51+
with:
52+
path: ${{ github.workspace }}/build/github-pages
53+
54+
deploy-coverage:
55+
needs: coverage
56+
permissions:
57+
pages: write
58+
id-token: write
59+
environment:
60+
name: github-pages
61+
url: ${{ steps.deployment.outputs.page_url }}
62+
runs-on: ubuntu-latest
63+
steps:
64+
- name: Publish
65+
id: deployment
66+
uses: actions/deploy-pages@v2

0 commit comments

Comments
 (0)