-
Notifications
You must be signed in to change notification settings - Fork 45
91 lines (80 loc) · 3.17 KB
/
build_docs.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
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
85
86
87
88
89
90
91
name: Documentation
on:
# Triggers the workflow on push or pull request events
push:
branches: [ master ]
pull_request:
branches: [ devel ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup environment
uses: mamba-org/setup-micromamba@v1
with:
environment-name: moose
condarc: |
channels:
- conda-forge
- https://conda.software.inl.gov/public
init-shell: bash
create-args: >-
moose-dev
lcov
- name: Compile RACCOON (with coverage)
if: ${{ github.event_name == 'push' }}
shell: bash -el {0}
run: |
coverage=true make -j 2
- name: Compile RACCOON (without coverage)
if: ${{ github.event_name == 'pull_request' }}
shell: bash -el {0}
run: |
make -j 2
- name: Build documentation
shell: bash -el {0}
run: |
mkdir gh-pages
cd doc
./moosedocs.py check
./moosedocs.py build --destination ../gh-pages/
- name: Extract coverage data
if: ${{ github.event_name == 'push' }}
shell: bash -l {0}
run: |
mkdir gh-pages/coverage
export RACCOON_DIR=$GITHUB_WORKSPACE
export RACCOON_SRC=$RACCOON_DIR/src
export RACCOON_INCLUDE=$RACCOON_DIR/include
export RACCOON_BUILD=$RACCOON_DIR/build
export COVERAGE_DIR=$RACCOON_DIR/gh-pages/coverage
lcov --gcov-tool gcov --capture --initial --directory $RACCOON_SRC --directory $RACCOON_BUILD --output-file $COVERAGE_DIR/initialize.info
./run_tests -j 2 || true
lcov --gcov-tool gcov --capture --ignore-errors gcov,source --directory $RACCOON_SRC --directory $RACCOON_BUILD --output-file $COVERAGE_DIR/covered.info
lcov --gcov-tool gcov --add-tracefile $COVERAGE_DIR/initialize.info --add-tracefile $COVERAGE_DIR/covered.info --output-file $COVERAGE_DIR/final.info
lcov --gcov-tool gcov --extract $COVERAGE_DIR/final.info \*$RACCOON_SRC/\* --extract $COVERAGE_DIR/final.info \*$RACCOON_INCLUDE/\* --output-file $COVERAGE_DIR/coverage.info
genhtml $COVERAGE_DIR/coverage.info --output-directory $COVERAGE_DIR > $COVERAGE_DIR/genhtml.out
cd scripts
echo "COVERAGE_PCT="$(python extract_coverage_percentage.py $COVERAGE_DIR/genhtml.out)"" >> $GITHUB_ENV
- name: Create coverage badge
if: ${{ github.event_name == 'push' }}
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_TOKEN }}
gistID: ${{ secrets.COVERAGE_GIST_ID }}
filename: RACCOON_coverage.json
label: coverage
message: ${{ env.COVERAGE_PCT }}
color: brightgreen
- name: Deploy to GitHub Pages
if: ${{ github.event_name == 'push' }}
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: gh-pages
single-commit: true