Skip to content

dune fmt

dune fmt #8

Workflow file for this run

name: CI
# Build et régression sont tous deux bloquants.
#
# Le garde-fou porte sur DEUX vérifications, et il faut les deux :
# - `harness.py run` : échecs inattendus, couverture des baselines, et les
# valeurs épinglées dans les `expected` des configs ;
# - `function-diff` : toute dérive par rapport aux rapports de logs/, y
# compris les AMÉLIORATIONS. C'est délibéré : `is_regressed` compte aussi
# `new_success`, donc un test qui se met à réussir bloque la CI jusqu'à ce
# qu'on l'entérine avec `harness.py promote`. Cela évite que logs/ diverge
# silencieusement de la réalité.
#
# Les régressions connues et acceptées ne bloquent pas : leur verdict courant
# est dans logs/ et leur config porte `"expected": {..., "pending": "..."}`.
# Les échecs connus portent `"expected": {"status": "FAIL", "reason": "..."}`.
# Dans les deux cas le test reste signalé s'il change de comportement.
on:
push:
branches: ["**"]
pull_request:
workflow_dispatch:
env:
REGRESSION_GATE: "true"
jobs:
build:
runs-on: ubuntu-latest
# Every step below runs in repo/. The checkout is deliberately NOT at the
# workspace root: setup-ocaml creates a local switch in _opam/, opam builds
# its dependencies under _opam/.opam-switch/build/, and dune resolves the
# workspace root by walking UP from there. With the repo at the root, mopsa
# built inside our workspace and its `make install` tried to install our
# own package ("_build/default/function.install is missing"). Keeping the
# repo one level down means no ancestor of _opam holds a dune-project.
defaults:
run:
working-directory: repo
steps:
- uses: actions/checkout@v4
with:
path: repo
# APRON links against GMP/MPFR/PPL, and mopsa's C parser against libclang
# (its depexts are: clang libclang-cpp-dev libclang-dev llvm-dev). opam
# would fail while compiling those bindings without the system headers.
- name: System dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libgmp-dev libmpfr-dev libppl-dev m4 pkg-config \
clang libclang-cpp-dev libclang-dev llvm-dev
- uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: "4.14"
# setup-ocaml installs the newest dune, and mopsa 1.2 does not build with
# >= 3.21 (dotted module names in a (select ...); see function.opam).
# Pick a compatible one explicitly so the solver does not have to
# downgrade a package it just installed.
- run: opam install --yes 'dune<3.21'
- run: opam install . --deps-only --yes
- name: Build
run: opam exec -- dune build
- name: Régression (sous-ensemble baseliné)
id: reg
continue-on-error: true
run: |
set +e
opam exec -- python3 script/harness.py run \
-o regression_out --layout flat --cover logs \
--short -t 30 -j 2
echo "run_rc=$?" >> "$GITHUB_OUTPUT"
python3 script/function-diff.py logs regression_out \
--regression --ignore-time | tee diff.txt
echo "diff_rc=${PIPESTATUS[0]}" >> "$GITHUB_OUTPUT"
- name: Résumé
if: always()
run: |
{
echo "## Régression"
echo ""
echo "run: rc=${{ steps.reg.outputs.run_rc }} · diff: rc=${{ steps.reg.outputs.diff_rc }}"
echo ""
if [ -s diff.txt ]; then
echo '<details><summary>diff</summary>'
echo ""
echo '```'
head -200 diff.txt
echo '```'
echo ""
echo '</details>'
fi
} >> "$GITHUB_STEP_SUMMARY"
- uses: actions/upload-artifact@v4
if: always()
with:
name: regression-${{ github.sha }}
# upload-artifact is a `uses` step, so defaults.run.working-directory
# does not apply: paths are relative to the workspace root.
path: |
repo/regression_out.run.json
repo/diff.txt
retention-days: 14
- name: Appliquer le garde-fou
if: env.REGRESSION_GATE == 'true'
run: |
[ "${{ steps.reg.outputs.run_rc }}" = "0" ] \
&& [ "${{ steps.reg.outputs.diff_rc }}" = "0" ] \
|| { echo "régression détectée"; exit 1; }