-
Notifications
You must be signed in to change notification settings - Fork 15
187 lines (172 loc) · 5.06 KB
/
developer.yml
File metadata and controls
187 lines (172 loc) · 5.06 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
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
187
name: developer
on:
push:
branches:
- develop
pull_request:
branches:
- develop
schedule:
# Run biweekly
- cron: '0 0 1 * *'
- cron: '0 0 15 * *'
workflow_dispatch:
# Cancel in-progress workflows when pushing to a branch
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
developer:
runs-on: ubuntu-24.04
container:
image: ghcr.io/noaa-emc/ci-common-build-cache/nceplibs-develop-ubuntu-24.04-gcc-14-mpich-x:latest
volumes:
- /home/runner/data:/root/data
strategy:
fail-fast: false
matrix:
config: ["asan", "code coverage", "memcheck", "docs", "format", "warning"]
steps:
- name: install-dependencies
run: |
apt-get update
apt-get install -y gcc g++
apt-get install -y clang-format doxygen gcovr
- name: load-env
shell: bash
run: |
set -a
source /entrypoint.sh
set +a
env >> $GITHUB_ENV
- name: checkout
uses: actions/checkout@v4
with:
path: g2c
- name: cache-data
id: cache-data
uses: actions/cache@v4
with:
path: /root/data
key: data-3
- name: asan
if: matrix.config == 'asan'
run: |
set -x
export CC=gcc
cmake -S g2c -B g2c/build \
-DUSE_AEC=ON \
-DBUILD_G2C=ON \
-DLOGGING=On \
-DPTHREADS=ON \
-DFTP_TEST_FILES=OFF \
-DFTP_LARGE_TEST_FILES=OFF \
-DTEST_FILE_DIR=/root/data \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="-g"
cmake --build g2c/build --parallel 2 --verbose
ctest --test-dir g2c/build --verbose --output-on-failure --rerun-failed
- name: warning
if: matrix.config == 'warning'
run: |
cd /root/
echo "Current root directory contents:"
ls -l
cd /__w/NCEPLIBS-g2c/NCEPLIBS-g2c/
set -x
export CC=gcc
cmake -S g2c -B g2c/build \
-DUSE_AEC=ON \
-DBUILD_G2C=ON \
-DLOGGING=On \
-DPTHREADS=ON \
-DFTP_TEST_FILES=ON \
-DFTP_LARGE_TEST_FILES=OFF \
-DTEST_FILE_DIR=/root/data \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="-g"
cmake --build g2c/build --verbose
- name: code_coverage
if: matrix.config == 'code coverage'
run: |
set -x
export CC=gcc
cmake -S g2c -B g2c/build \
-DUSE_AEC=ON \
-DBUILD_G2C=ON \
-DLOGGING=On \
-DPTHREADS=ON \
-DFTP_TEST_FILES=OFF \
-DFTP_LARGE_TEST_FILES=OFF \
-DTEST_FILE_DIR=/root/data \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="-g"
pwd
cd g2c/build
make VERBOSE=1
ctest --verbose --output-on-failure --rerun-failed
gcovr --root .. -v --html-details --exclude tests --exclude CMakeFiles --print-summary -o test-coverage.html
pwd
ls -l
ls -l src
- name: memcheck
if: matrix.config == 'memcheck'
run: |
set -x
cmake -S g2c -B g2c/build \
-DUSE_AEC=ON \
-DBUILD_G2C=ON \
-DLOGGING=On \
-DPTHREADS=ON \
-DFTP_TEST_FILES=OFF \
-DTEST_FILE_DIR=/root/data \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="-g"
cmake --build g2c/build --parallel 2 --verbose
ctest --test-dir g2c/build
ls -l g2c/build
- name: docs
if: matrix.config == 'docs'
run: |
set -x
cmake -S g2c -B g2c/build \
-DUSE_AEC=ON \
-DBUILD_G2C=ON \
-DENABLE_DOCS=On \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS="-g"
cmake --build g2c/build --parallel 2 --verbose
ls -l g2c/build/docs/html
- name: format
if: matrix.config == 'format'
run: |
set -x
cd g2c
clang-format --version
find . -name '*.[ch]'|xargs clang-format -Werror --verbose --dry-run
- name: populate-data
if: steps.cache-data.outputs.cache-hit != 'true' && matrix.config == 'warning'
run: |
cd /root/data
ls -l
if [ -d "$GITHUB_WORKSPACE/g2c/build/tests/data" ]; then
cp -r $GITHUB_WORKSPACE/g2c/build/tests/data/* /root/data
elif [ -d "$GITHUB_WORKSPACE/g2c/tests/data/" ]; then
cp -r $GITHUB_WORKSPACE/g2c/tests/data/* /root/data
else
echo "Warning: no test data directory found at either $GITHUB_WORKSPACE/g2c/tests/data or $GITHUB_WORKSPACE/g2c/build/tests/data"
fi
- name: upload-test-coverage
if: matrix.config == 'code coverage'
uses: actions/upload-artifact@v4
with:
name: g2c-test-coverage
path: |
*.html
*.css
- uses: actions/upload-artifact@v4
if: matrix.config == 'docs'
with:
name: docs
path: |
g2c/build/docs/html