4040 - " book/src/changelog.md"
4141 - " book/en/src/changelog.md"
4242 workflow_dispatch :
43+ inputs :
44+ candidate_run :
45+ description : ' Optional successful d2learn/d2x CI run ID (explicit prerelease override)'
46+ type : string
47+ default : ' '
48+ candidate_sha :
49+ description : ' Exact checkout SHA recorded in that candidate provenance'
50+ type : string
51+ default : ' '
52+ diagnose :
53+ description : ' Also compare standalone build and checker in separate cold Windows environments'
54+ type : boolean
55+ default : false
4356 schedule :
4457 - cron : ' 23 4 * * 1'
4558
4659permissions :
4760 contents : read
61+ actions : read
62+
63+ env :
64+ XLINGS_NON_INTERACTIVE : ' 1'
65+ D2X_CANDIDATE_SHA : ${{ inputs.candidate_sha }}
66+ D2X_CANDIDATE_DIR : .d2x/candidate
4867
4968jobs :
5069 native :
70+ if : ${{ !inputs.diagnose }}
5171 name : fresh (${{ matrix.os }}, ${{ matrix.route }}, MSVC=${{ !matrix.mask_msvc }})
5272 runs-on : ${{ matrix.os }}
5373 timeout-minutes : 60
6282 - {os: windows-2025, route: cold, mask_msvc: true}
6383 steps :
6484 - uses : actions/checkout@v4
85+ - uses : actions/download-artifact@v4
86+ if : inputs.candidate_run != ''
87+ with :
88+ repository : d2learn/d2x
89+ run-id : ${{ inputs.candidate_run }}
90+ github-token : ${{ github.token }}
91+ name : ${{ runner.os == 'Linux' && 'candidate-linux-x86_64' || format('candidate-{0}', matrix.os) }}
92+ path : ${{ env.D2X_CANDIDATE_DIR }}
93+ - name : Verify explicit candidate provenance
94+ if : inputs.candidate_run != ''
95+ shell : bash
96+ run : ${{ runner.os == 'Windows' && 'python' || 'python3' }} scripts/ci/candidate.py
6597 - name : Select an empty toolchain home
6698 shell : bash
6799 run : echo "MCPP_HOME=$RUNNER_TEMP/d2mcpp-fresh" >> "$GITHUB_ENV"
@@ -85,11 +117,11 @@ jobs:
85117 run : python scripts/ci/readme.py
86118 - name : Cold install only (Unix)
87119 if : runner.os != 'Windows' && matrix.route == 'cold'
88- run : bash scripts/setup.sh --install-only
120+ run : python3 scripts/ci/prepare.py --install-only
89121 - name : Cold install only (PowerShell 5.1)
90122 if : runner.os == 'Windows' && matrix.route == 'cold'
91123 shell : powershell
92- run : ./ scripts/setup.ps1 -InstallOnly
124+ run : python scripts/ci/prepare.py --install-only
93125 - name : First check, save, advance and resume
94126 if : matrix.route == 'cold'
95127 shell : bash
@@ -104,7 +136,7 @@ jobs:
104136 ROUTE : ${{ matrix.route }}
105137 run : |
106138 logs="$(pwd)/.d2x/ci-logs"
107- if [[ "$ROUTE" == readme ]]; then cd .d2x/ci-work/download/d2mcpp ; fi
139+ if [[ "$ROUTE" == readme ]]; then cd "$(cat "$logs/readme-course-path.txt")" ; fi
108140 # doctor returns nonzero for warnings too (missing MSVC is expected).
109141 mcpp self doctor > "$logs/doctor.txt" 2>&1 || true
110142 cat "$logs/doctor.txt"
@@ -121,6 +153,7 @@ jobs:
121153 include-hidden-files : true
122154
123155 linux-minimal :
156+ if : ${{ !inputs.diagnose }}
124157 name : fresh (Linux without a compiler, ${{ matrix.route }})
125158 runs-on : ubuntu-24.04
126159 container : ubuntu:24.04
@@ -138,6 +171,18 @@ jobs:
138171 ! command -v g++
139172 ! command -v clang++
140173 - uses : actions/checkout@v4
174+ - uses : actions/download-artifact@v4
175+ if : inputs.candidate_run != ''
176+ with :
177+ repository : d2learn/d2x
178+ run-id : ${{ inputs.candidate_run }}
179+ github-token : ${{ github.token }}
180+ name : candidate-linux-x86_64
181+ path : ${{ env.D2X_CANDIDATE_DIR }}
182+ - name : Verify explicit candidate provenance
183+ if : inputs.candidate_run != ''
184+ shell : bash
185+ run : ${{ runner.os == 'Windows' && 'python' || 'python3' }} scripts/ci/candidate.py
141186 - name : Give the ordinary user a fresh checkout
142187 shell : bash
143188 env :
@@ -158,7 +203,7 @@ jobs:
158203 run : |
159204 cd "$COURSE_DIR"
160205 if [[ "$ROUTE" == cold ]]; then
161- runuser -u learner -- bash scripts/setup.sh --install-only
206+ runuser -u learner -- python3 scripts/ci/prepare.py --install-only
162207 runuser -u learner -- env MCPP_HOME=/home/learner/.mcpp PATH="/home/learner/.xlings/subos/current/bin:$PATH" python3 scripts/ci/first-run.py --allow-source-edit --cold
163208 runuser -u learner -- env PATH="/home/learner/.xlings/subos/current/bin:$PATH" python3 scripts/ci/solutions.py
164209 else
@@ -174,7 +219,7 @@ jobs:
174219
175220 released-course :
176221 name : Published d2x install route (main only)
177- if : github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
222+ if : github.event_name != 'pull_request' && github.ref == 'refs/heads/main' && inputs.candidate_run == ''
178223 runs-on : ubuntu-24.04
179224 timeout-minutes : 60
180225 steps :
@@ -188,3 +233,61 @@ jobs:
188233 path : .d2x/ci-logs/
189234 if-no-files-found : ignore
190235 include-hidden-files : true
236+
237+ cold-diagnostics :
238+ if : inputs.diagnose
239+ runs-on : windows-2025
240+ strategy :
241+ fail-fast : false
242+ matrix :
243+ route : [build, run, checker]
244+ steps :
245+ - uses : actions/checkout@v4
246+ - name : Mask MSVC
247+ shell : powershell
248+ run : ./scripts/ci/mask-msvc.ps1
249+ - name : Select independent cold home
250+ shell : bash
251+ run : echo "MCPP_HOME=$RUNNER_TEMP/diagnostic-${{ matrix.route }}" >> "$GITHUB_ENV"
252+ - name : Install tools only
253+ shell : powershell
254+ run : python scripts/ci/prepare.py --install-only
255+ - name : Diagnose baseline cold startup
256+ shell : bash
257+ env :
258+ DIAGNOSTIC_ROUTE : ${{ matrix.route }}
259+ run : python scripts/ci/cold-diagnostics.py
260+ - uses : actions/upload-artifact@v4
261+ if : always()
262+ with :
263+ name : cold-diagnostic-${{ matrix.route }}
264+ path : .d2x/ci-logs/
265+ include-hidden-files : true
266+
267+ latest-stable :
268+ if : github.ref == 'refs/heads/main' && inputs.candidate_run == ''
269+ runs-on : ${{ matrix.os }}
270+ strategy :
271+ fail-fast : false
272+ matrix :
273+ os : [ubuntu-24.04, macos-14, windows-2025]
274+ steps :
275+ - uses : actions/checkout@v4
276+ - name : Install xlings (Unix)
277+ if : runner.os != 'Windows'
278+ run : bash scripts/install-xlings.sh
279+ - name : Install xlings (PowerShell 5.1)
280+ if : runner.os == 'Windows'
281+ shell : powershell
282+ run : ./scripts/install-xlings.ps1
283+ - name : Check stable release, public latest and course pin
284+ shell : bash
285+ env :
286+ GH_TOKEN : ${{ github.token }}
287+ run : ${{ runner.os == 'Windows' && 'python' || 'python3' }} scripts/ci/latest.py
288+ - uses : actions/upload-artifact@v4
289+ if : always()
290+ with :
291+ name : latest-stable-versions-${{ matrix.os }}
292+ path : .d2x/ci-logs/
293+ include-hidden-files : true
0 commit comments