ci(test): enforce coverage-based test selection on PRs #313
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: FP Stability | |
| # Runs the Verrou-based floating-point stability suite. | |
| # | |
| # What it tests (./mfc.sh fp-stability): | |
| # sod_standard 1-D standard Sod, p_L/p_R=10, ideal gas (well-conditioned baseline) | |
| # 25 cells, 5 steps, WENO5 + HLLC | |
| # Threshold 1e-13 — should always pass | |
| # | |
| # sod_strong 1-D Sod shock, p_L/p_R=100,000, ideal gas | |
| # 50 cells, 10 steps, WENO5 + HLLC | |
| # Threshold 1e-10 | |
| # Probes: HLLC xi-factor cancellation near sonic contact | |
| # (s_L - vel_L)/(s_L - s_S) when s_L ≈ s_S | |
| # | |
| # water_stiffened 1-D water shock, stiffened EOS (pi_inf=4046) | |
| # 50 cells, 10 steps, WENO5 + HLLC | |
| # Threshold 1e-8 (loosened; tightens to 1e-10 once Etilde scheme merges) | |
| # Probes: pressure-recovery cancellation p=(E-pi_inf)/gamma | |
| # loses ~4 decimal digits when pi_inf/p_right ~ 40,000 | |
| # | |
| # For each case: 1 nearest-rounding reference run + N random-rounding runs. | |
| # PASS if max L∞ deviation across all N samples stays below threshold. | |
| # On FAIL: verrou_dd_sym runs to identify the responsible function symbols. | |
| # Logs are uploaded as CI artifacts. | |
| # | |
| # Verrou (Valgrind 3.26.0 + edf-hpc/verrou@a58d434) is built once and cached. | |
| # Build takes ~20 min uncached; cached runs restore in ~30 s. | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| workflow_dispatch: | |
| jobs: | |
| file-changes: | |
| name: Detect File Changes | |
| runs-on: ubuntu-latest | |
| outputs: | |
| checkall: ${{ steps.changes.outputs.checkall }} | |
| steps: | |
| - name: Clone | |
| uses: actions/checkout@v4 | |
| - name: Detect Changes | |
| uses: dorny/paths-filter@v3 | |
| id: changes | |
| with: | |
| filters: ".github/file-filter.yml" | |
| fp-stability: | |
| name: Floating-Point Stability (Verrou) | |
| runs-on: ubuntu-latest | |
| needs: [file-changes] | |
| if: >- | |
| !cancelled() && | |
| needs.file-changes.result == 'success' && | |
| (needs.file-changes.outputs.checkall == 'true' || github.event_name == 'workflow_dispatch') | |
| steps: | |
| - name: Clone | |
| uses: actions/checkout@v4 | |
| - name: Cache Verrou | |
| id: cache-verrou | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.local/verrou | |
| key: verrou-a58d434-valgrind-3.26.0-${{ runner.os }} | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update -y | |
| sudo apt-get install -y \ | |
| build-essential automake python3 python3-numpy libc6-dbg \ | |
| cmake gfortran | |
| - name: Build Verrou | |
| if: steps.cache-verrou.outputs.cache-hit != 'true' | |
| run: | | |
| cd /tmp | |
| wget -q https://sourceware.org/pub/valgrind/valgrind-3.26.0.tar.bz2 | |
| tar xf valgrind-3.26.0.tar.bz2 | |
| git clone https://github.com/edf-hpc/verrou.git | |
| git -C verrou checkout a58d434 | |
| # Merge Verrou into Valgrind source tree and patch | |
| cp -r verrou valgrind-3.26.0/verrou | |
| cd valgrind-3.26.0 | |
| cat verrou/valgrind.*diff | patch -p1 | |
| ./autogen.sh | |
| ./configure --enable-only64bit --prefix="$HOME/.local/verrou" | |
| make -j"$(nproc)" | |
| make install | |
| - name: Verify Verrou | |
| run: ~/.local/verrou/bin/valgrind --version | |
| - name: Build MFC (debug, serial) | |
| # FFLAGS=-fno-inline prevents gfortran from inlining small functions into | |
| # their callers. Without it, DWARF debug info attributes inlined ops to | |
| # the caller's line (often a do-loop header), making Verrou dd_line point | |
| # to loop boundaries instead of the actual arithmetic. | |
| env: | |
| FFLAGS: "-fno-inline" | |
| run: ./mfc.sh build -t pre_process simulation --no-mpi --debug -j"$(nproc)" | |
| - name: Run FP Stability Suite | |
| run: ./mfc.sh fp-stability -N 5 | |
| - name: Upload FP stability logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: fp-stability-logs | |
| path: fp-stability-logs/ | |
| if-no-files-found: ignore |