Skip to content

Commit d792134

Browse files
committed
ci: capture compiler warnings from all CI matrix builds
1 parent 2f04943 commit d792134

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

.github/workflows/test.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,33 @@ jobs:
261261
TEST_ALL: ${{ matrix.mpi == 'mpi' && '--test-all' || '' }}
262262
PRECISION: ${{ matrix.precision != '' && format('--{0}', matrix.precision) || '' }}
263263

264+
- name: Collect Compiler Warnings
265+
if: always()
266+
run: |
267+
echo "::group::Compiler warnings"
268+
for staging_dir in build/staging/*/; do
269+
[ -f "$staging_dir/CMakeCache.txt" ] || continue
270+
target=$(ls "$staging_dir/CMakeFiles/"*".dir" -d 2>/dev/null | head -1 | sed 's/.*CMakeFiles\///;s/\.dir//')
271+
[ -z "$target" ] && continue
272+
echo "=== Rebuilding $target for warnings ==="
273+
cd "$staging_dir"
274+
find fypp/ -name '*.f90' -exec touch {} + 2>/dev/null
275+
make "$target" -j1 2>&1 | grep -E "Warning:|warning:" -B2 > /tmp/warnings_${target}.txt 2>&1 || true
276+
count=$(grep -c "Warning:\|warning:" /tmp/warnings_${target}.txt 2>/dev/null || echo 0)
277+
echo "--- $target: $count warnings ---"
278+
cat /tmp/warnings_${target}.txt
279+
cd - > /dev/null
280+
done
281+
echo "::endgroup::"
282+
283+
- name: Upload Warning Reports
284+
if: always()
285+
uses: actions/upload-artifact@v4
286+
with:
287+
name: warnings-${{ matrix.os }}-${{ matrix.mpi }}-${{ matrix.debug }}-intel-${{ matrix.intel }}
288+
path: /tmp/warnings_*.txt
289+
if-no-files-found: ignore
290+
264291
- name: Test
265292
run: |
266293
/bin/bash mfc.sh test -v --max-attempts 3 -j $(nproc) $ONLY_CHANGES $TEST_ALL $TEST_PCT

0 commit comments

Comments
 (0)