-
Notifications
You must be signed in to change notification settings - Fork 86
186 lines (167 loc) · 9.88 KB
/
CI.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
name: CI
on: [push, pull_request]
jobs:
Build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
gcc_v: [7,8,9,10,11] # Version of GFortran we want to use.
python-version: [3.11]
env:
FC: gfortran-${{matrix.gcc_v}}
GCC_V: ${{matrix.gcc_v}}
steps:
- name: Set vars
id: vars
# run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} # this is depreciated: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
run: echo "name=tag::${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Checkout code
uses: actions/checkout@v4.1.6
with:
submodules: recursive
- name: Setup cmake
if: contains( matrix.gcc_v, 9 )
uses: jwlawson/actions-setup-cmake@v2.0.2
with:
cmake-version: '3.28.x'
- name: Install Python
uses: actions/setup-python@v5.1.0 # Use pip to install latest CMake, & FORD/Jin2For, etc.
with:
python-version: ${{ matrix.python-version }}
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v2.0.2
- name: Install Python dependencies
if: contains( matrix.os, 'ubuntu')
run: |
python -m pip install --upgrade pip
pip install ford FoBiS.py pygooglechart fpm
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install GFortran Linux
if: contains( matrix.os, 'ubuntu')
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y gcc-${GCC_V} gfortran-${GCC_V}
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
--slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}
- name: Compile_with_build
if: matrix.gcc_v != 7 && matrix.gcc_v != 11
run: |
GFORTRAN=gfortran-${{matrix.gcc_v}}
GCOV=gcov-${{matrix.gcc_v}}
# build with build.sh, run unit tests
./build.sh --skip-documentation
./build.sh --skip-documentation --enable-unicode
- name: Compile_with_FPM
if: matrix.gcc_v == 11
run: |
GFORTRAN=gfortran-${{matrix.gcc_v}}
GCOV=gcov-${{matrix.gcc_v}}
sudo apt update && sudo apt install -y valgrind
fpm test jf_test_01 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_02 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_03 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_04 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_05 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_06 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_07 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_08 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_09 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_10 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_11 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_12 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_13 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_14 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_15 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_16 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_17 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_18 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_19 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_20 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_21 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_22 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_23 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_24 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_25 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_26 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_27 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_28 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_29 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_30 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_31 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_32 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_33 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_34 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_35 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_36 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_37 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_38 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_39 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_40 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_41 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_42 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_43 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_44 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_45 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_46 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_47 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_48 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_49 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_50 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
fpm test jf_test_51 --runner "valgrind --leak-check=full --show-leak-kinds=all --error-exitcode=1"
- name: Compile_with_cmake
# CMake build with unit tests, no documentation, with coverage analysis
# No unicode so that coverage combined with the build script will cover unicode
# and non-unicode code paths
if: matrix.gcc_v == 9
run: |
GFORTRAN=gfortran-${{matrix.gcc_v}}
GCOV=gcov-${{matrix.gcc_v}}
mkdir cmake-build
cd cmake-build
cmake -D ENABLE_TESTS=ON ..
make -j 4 check
- name: Compile_with_build_mkdocs
# build with build.sh, make documentation, run unit tests
# and perform coverage analysis - used for doc deployment
if: matrix.gcc_v == 7
run: |
GFORTRAN=gfortran-${{matrix.gcc_v}}
GCOV=gcov-${{matrix.gcc_v}}
./build.sh --coverage --skip-documentation
./build.sh --coverage --enable-unicode
- name: Deploy Documentation for master
if: matrix.gcc_v == 7 && github.ref == 'refs/heads/master'
uses: JamesIves/github-pages-deploy-action@4.1.3
with:
branch: gh-pages # The branch the action should deploy to.
folder: doc # The folder the action should deploy.
clean: true
clean-exclude: |
prev
- name: Rebuild documentation for tagged release
env:
TAGNAME: ${{ steps.vars.outputs.tag }}
if: matrix.gcc_v == 7 && startsWith(github.ref, 'refs/tags/')
run: |
echo ${TAGNAME}
rm -rf doc
sed "2 s/^/version: ${TAGNAME}\n/" json-fortran.md > json-fortran.tagged.md
ford --debug json-fortran.tagged.md
- name: Deploy documentation for tagged release
if: matrix.gcc_v == 7 && startsWith(github.ref, 'refs/tags/')
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
branch: gh-pages # The branch the action should deploy to.
folder: doc # The folder the action should deploy.
target-folder: prev/${{ steps.vars.outputs.tag }} # deploy to a version-specific folder
- name: Upload coverage
if: matrix.gcc_v == 7
run: |
rm json_*.F90-*unicode.gcov || true
mv json_*.F90.gcov src/
mv jf_test*.[fF]90.gcov src/tests/
bash <(curl -s https://codecov.io/bash) -v -X $GCOV