@@ -16,56 +16,86 @@ concurrency:
1616 cancel-in-progress : true
1717
1818jobs :
19- stable-build :
20- name : stable
19+ environment :
20+ name : resolve reference environment
2121 runs-on : ubuntu-24.04
22- container :
23- image : ghcr.io/${{ github.repository }}-why3:1.7.2
24- credentials :
25- username : ${{ github.actor }}
26- password : ${{ secrets.GITHUB_TOKEN }}
22+ outputs :
23+ image : ${{ steps.lock.outputs.image }}
2724 steps :
28- - uses : actions/checkout@v6
25+ - uses : actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803
2926
30- - name : Trust checkout workspace
31- run : git config --global --add safe.directory "$GITHUB_WORKSPACE"
27+ - name : Read the unique environment lock
28+ id : lock
29+ run : |
30+ image="$(node -e '
31+ const { readEnvironmentLock } = require("./tools/why3_reference/reference_environment.cjs");
32+ const lock = readEnvironmentLock();
33+ process.stdout.write(`${lock.image.repository}@${lock.image.digest}`);
34+ ')"
35+ echo "image=$image" >> "$GITHUB_OUTPUT"
3236
33- - name : Setup Moon
34- uses : moonbit-community/setup-moonbit@main
35- with :
36- version : stable
37+ project :
38+ name : project
39+ runs-on : ubuntu-24.04
40+ steps :
41+ - uses : actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803
3742
38- - name : moon update
39- run : moon update
43+ - name : Set up MoonBit stable
44+ uses : moonbit-community/setup-moonbit@04293a8a813bfd4b6c2fce22701b52ae1050d100
45+ with :
46+ version : stable
4047
41- - name : Show tool versions
48+ - name : Install the non-contractual project prover
4249 run : |
43- moon version --all
44- moonrun --version
50+ sudo apt-get update
51+ sudo apt-get install --yes z3
4552
46- - name : Show Why3 version
47- run : why3 --version
53+ - name : Bootstrap and check the project
54+ run : |
55+ node tools/run.mjs bootstrap
56+ node tools/run.mjs project
4857
49- - name : Check all targets
50- run : moon check --target all --warn-list +73
58+ reference :
59+ name : fixed reference
60+ needs :
61+ - environment
62+ - project
63+ runs-on : ubuntu-24.04
64+ container :
65+ image : ${{ needs.environment.outputs.image }}
66+ credentials :
67+ username : ${{ github.actor }}
68+ password : ${{ secrets.GITHUB_TOKEN }}
69+ env :
70+ WHY3_REFERENCE_CACHE_DIR : ${{ github.workspace }}/.cache/why3-reference
71+ WHY3_REFERENCE_CONTEXT_DIR : ${{ github.workspace }}/_build/reference-context
72+ steps :
73+ - uses : actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803
5174
52- - name : Test all targets
53- run : |
54- moon test --target all --serial --release
55- moon test --target all --serial
75+ - name : Trust checkout workspace
76+ run : git config --global --add safe.directory "$GITHUB_WORKSPACE"
5677
57- - name : Test Node.js tools
58- run : node --test tools/*.test.mjs
78+ - name : Restore patched Why3 runtime
79+ uses : actions/cache@5a3ec84eff668545956fd18022155c47e93e2684
80+ with :
81+ path : ${{ env.WHY3_REFERENCE_CACHE_DIR }}
82+ key : reference-runtime-${{ runner.os }}-${{ hashFiles('tools/contracts/reference-environment-lock-v1.json', 'tools/why3_reference/reference_runtime.mjs', 'tools/why3_reference/patches/driver-trace.patch') }}
5983
60- - name : Check Why3 fixtures
61- run : node tools/check_why3_fixtures.mjs
84+ - name : Set up MoonBit stable
85+ uses : moonbit-community/setup-moonbit@04293a8a813bfd4b6c2fce22701b52ae1050d100
86+ with :
87+ version : stable
6288
63- - name : Check generated interfaces
89+ - name : Check the fixed reference
6490 run : |
65- moon info
66- git diff --exit-code
91+ node tools/run.mjs bootstrap
92+ node tools/run.mjs reference \
93+ --why3-archive "$WHY3_REFERENCE_ARCHIVE"
6794
68- - name : Check formatting
69- run : |
70- moon fmt
71- git diff --exit-code
95+ - name : Upload resolved environment provenance
96+ if : always()
97+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
98+ with :
99+ name : reference-context-${{ github.sha }}
100+ path : ${{ env.WHY3_REFERENCE_CONTEXT_DIR }}
101+ if-no-files-found : warn
0 commit comments