@@ -261,6 +261,35 @@ 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+ # Skip dependency builds (fftw, hdf5, silo, lapack)
271+ case "$staging_dir" in *fftw*|*hdf5*|*silo*|*lapack*) continue ;; esac
272+ target=$(find "$staging_dir/CMakeFiles/" -maxdepth 1 -name '*.dir' -type d 2>/dev/null | head -1 | xargs basename 2>/dev/null | sed 's/\.dir//')
273+ [ -z "$target" ] && continue
274+ echo "=== Rebuilding $target for warnings ==="
275+ cd "$staging_dir"
276+ find fypp/ -name '*.f90' -exec touch {} + 2>/dev/null
277+ make "$target" -j1 2>&1 | grep -E "Warning:|warning:" -B2 > /tmp/warnings_${target}.txt 2>&1 || true
278+ count=$(grep -c "Warning:\|warning:" /tmp/warnings_${target}.txt 2>/dev/null || echo 0)
279+ echo "--- $target: $count warnings ---"
280+ cat /tmp/warnings_${target}.txt
281+ cd - > /dev/null
282+ done
283+ echo "::endgroup::"
284+
285+ - name : Upload Warning Reports
286+ if : always()
287+ uses : actions/upload-artifact@v4
288+ with :
289+ name : warnings-${{ matrix.os }}-${{ matrix.mpi }}-${{ matrix.debug }}-intel-${{ matrix.intel }}
290+ path : /tmp/warnings_*.txt
291+ if-no-files-found : ignore
292+
264293 - name : Test
265294 run : |
266295 /bin/bash mfc.sh test -v --max-attempts 3 -j $(nproc) $ONLY_CHANGES $TEST_ALL $TEST_PCT
@@ -278,8 +307,7 @@ jobs:
278307 needs.file-changes.result == 'success' &&
279308 (needs.rebuild-cache.result == 'success' || needs.rebuild-cache.result == 'skipped') &&
280309 github.repository == 'MFlowCode/MFC' &&
281- needs.file-changes.outputs.checkall == 'true' &&
282- github.event.pull_request.draft != true
310+ needs.file-changes.outputs.checkall == 'true'
283311 # Frontier CCE compiler is periodically broken by toolchain updates (e.g.
284312 # cpe/25.03 introduced an IPA SIGSEGV in CCE 19.0.0). Allow Frontier to
285313 # fail without blocking PR merges; Phoenix remains a hard gate.
@@ -408,6 +436,20 @@ jobs:
408436 - name : Build
409437 run : bash .github/scripts/submit-slurm-job.sh .github/workflows/common/build.sh ${{ matrix.device }} ${{ matrix.interface }} ${{ matrix.cluster }} ${{ matrix.shard }}
410438
439+ - name : Collect Compiler Warnings
440+ if : always()
441+ run : |
442+ bash .github/scripts/submit-slurm-job.sh .github/workflows/common/collect-warnings.sh ${{ matrix.device }} ${{ matrix.interface }} ${{ matrix.cluster }} ${{ matrix.shard }} || true
443+
444+ - name : Print Warnings
445+ if : always()
446+ run : |
447+ echo "::group::Compiler warnings (${{ matrix.cluster_name }} ${{ matrix.device }}-${{ matrix.interface }})"
448+ for f in collect-warnings-*.out; do
449+ [ -f "$f" ] && cat "$f"
450+ done
451+ echo "::endgroup::"
452+
411453 - name : Test
412454 run : bash .github/scripts/submit-slurm-job.sh .github/workflows/common/test.sh ${{ matrix.device }} ${{ matrix.interface }} ${{ matrix.cluster }} ${{ matrix.shard }}
413455
0 commit comments