Repository navigation
226 lines (193 loc) · 8.18 KB
/
Copy pathsite.yml
File metadata and controls
226 lines (193 loc) · 8.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
name: Site
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: site
cancel-in-progress: true
jobs:
build:
if: ${{ github.server_url == 'https://github.com' }}
runs-on: ubuntu-latest
# A wedged step must fail the run, not sit on it. The default is six hours,
# which is how a hanging browser check burned a deploy instead of reporting.
timeout-minutes: 35
steps:
- uses: actions/checkout@v4
- name: Checkout SolverForge runtime source
uses: actions/checkout@v4
with:
repository: SolverForge/solverforge
path: .ci/solverforge-rs
fetch-depth: 0
- name: Checkout SolverForge maps source
uses: actions/checkout@v4
with:
repository: SolverForge/solverforge-maps
path: .ci/solverforge-maps
- name: Checkout SolverForge UI source
uses: actions/checkout@v4
with:
repository: SolverForge/solverforge-ui
path: .ci/solverforge-ui
# The bench docs page describes this revision; the companion-docs gate
# compares the page with its Makefile, harness, and migrations.
- name: Checkout documented SolverForge bench revision
uses: actions/checkout@v4
with:
repository: SolverForge/solverforge-bench
ref: 712a30205590f8aad81ce42bf360a281cd152f0f
path: .ci/solverforge-bench
- name: Install Rust 1.95
run: |
rustup toolchain install 1.95.0 --profile minimal
rustup default 1.95.0
# The maintenance walkthrough and the CLI Getting Started page replay
# their commands with the published CLI and solve the result, so CI
# needs the exact release they document (scripts/release_pins.rb).
- name: Cache the walkthrough toolchain
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin/solverforge
~/.cache/walkthrough-target
~/.cache/getting-started-target
key: walkthrough-solverforge-cli-3.9.0-${{ hashFiles('scripts/fixtures/maintenance-walkthrough/**') }}
restore-keys: walkthrough-solverforge-cli-3.9.0-
# The Rust library pages compile and run against crates.io solverforge;
# keep that build between runs.
- name: Cache the Rust snippet build
uses: actions/cache@v4
with:
path: ~/.cache/rust-snippets-target
key: rust-snippets-${{ hashFiles('scripts/lib/rust_pages.rb') }}-${{ github.sha }}
restore-keys: rust-snippets-${{ hashFiles('scripts/lib/rust_pages.rb') }}-
# The solver-page gate parses and solves every config block with the
# published solverforge crate pinned in its fixture's Cargo.lock.
- name: Cache the solver-config fixture build
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cache/solver-config-target
key: solver-config-${{ hashFiles('scripts/fixtures/solver-config/Cargo.lock') }}-${{ hashFiles('scripts/fixtures/solver-config/src/**') }}
restore-keys: solver-config-${{ hashFiles('scripts/fixtures/solver-config/Cargo.lock') }}-
- name: Install solverforge-cli 3.9.0
run: |
if ! solverforge --version 2>/dev/null | grep -q 'CLI version: 3.9.0'; then
cargo install solverforge-cli --version 3.9.0 --locked --force
fi
solverforge --version
# The Python docs gate installs the published PyPI package into fresh
# venvs and replays the pages, so CI needs the interpreter they name.
- uses: actions/setup-python@v5
with:
python-version: "3.14"
cache: pip
cache-dependency-path: src/docs/solverforge-python/*.md
# The UI getting-started gate builds the page's crate from crates.io.
- name: Cache the UI getting-started build
uses: actions/cache@v4
with:
path: ~/.cache/ui-gate-target
key: ui-gate-${{ hashFiles('src/docs/solverforge-ui/getting-started.md') }}
restore-keys: ui-gate-
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: package-lock.json
- name: Install dependencies
run: make install
- name: Install Playwright browsers
# Chrome carries the H.264/AAC decoders the media checks need; the
# bundled Chromium cannot load any MP4.
run: npx playwright install --with-deps chromium chrome
- name: Run local CI gate
env:
SOLVERFORGE_RS_REPO: ${{ github.workspace }}/.ci/solverforge-rs
SOLVERFORGE_MAPS_REPO: ${{ github.workspace }}/.ci/solverforge-maps
SOLVERFORGE_UI_REPO: ${{ github.workspace }}/.ci/solverforge-ui
SOLVERFORGE_BENCH_REPO: ${{ github.workspace }}/.ci/solverforge-bench
PLAYWRIGHT_CHANNEL: chrome
# The use-case tutorial replays build two apps each and run their
# test suites, so they run in the `tutorials` job below instead.
run: SOLVERFORGE_WALKTHROUGH_TARGET_DIR="$HOME/.cache/walkthrough-target" SOLVERFORGE_GETTING_STARTED_TARGET_DIR="$HOME/.cache/getting-started-target" SOLVERFORGE_SNIPPETS_TARGET_DIR="$HOME/.cache/rust-snippets-target" SOLVER_CONFIG_TARGET_DIR="$HOME/.cache/solver-config-target" SOLVERFORGE_UI_GATE_TARGET_DIR="$HOME/.cache/ui-gate-target" make ci-local TUTORIAL_REPLAYS=
- name: Configure Pages
if: github.event_name != 'pull_request'
uses: actions/configure-pages@v5
- name: Upload Pages artifact
if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v3
with:
path: output
# Each use-case page is replayed the way a reader follows it: the published
# CLI builds and solves the page's app, the Hugging Face Space it names is
# cloned, solved, compared with the page, and validated with the page's own
# commands. See scripts/lib/use_case_tutorial.rb.
tutorials:
if: ${{ github.server_url == 'https://github.com' }}
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
page: [hospital, lessons, deliveries, fsr]
steps:
- uses: actions/checkout@v4
- name: Install Rust 1.95
run: |
rustup toolchain install 1.95.0 --profile minimal --component rustfmt,clippy
rustup default 1.95.0
- name: Cache the tutorial toolchain and builds
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cache/solverforge-cli
~/.cache/tutorial-target
~/.cache/tutorial-osm
key: tutorial-${{ matrix.page }}-${{ hashFiles(format('src/docs/getting-started/solverforge-{0}-use-case.md', matrix.page), 'scripts/lib/*.rb') }}
restore-keys: tutorial-${{ matrix.page }}-
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Replay the ${{ matrix.page }} tutorial
env:
# The Space's browser tests use the runner's Chrome instead of
# downloading Playwright's Chromium.
PLAYWRIGHT_CHROMIUM_EXECUTABLE: /usr/bin/google-chrome
run: |
export TUTORIAL_REPLAY_TARGET_DIR="$HOME/.cache/tutorial-target"
export TUTORIAL_REPLAY_OSM_CACHE="$HOME/.cache/tutorial-osm"
# The public Overpass API blocks cloud runners; see use_case_tutorial.rb.
export TUTORIAL_REPLAY_OVERPASS=0
make verify-${{ matrix.page }}-tutorial
deploy:
if: ${{ github.server_url == 'https://github.com' && github.event_name != 'pull_request' }}
needs: [build, tutorials]
runs-on: ubuntu-latest
timeout-minutes: 10
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4