|
68 | 68 |
|
69 | 69 | # Restore binary cache |
70 | 70 |
|
71 | | - - name: Handle cached EdgeDB CLI binaries |
72 | | - uses: actions/cache@v4 |
73 | | - id: cli-cache |
74 | | - with: |
75 | | - path: build/cli |
76 | | - key: edb-cli-v4-${{ env.EDGEDBCLI_GIT_REV }} |
77 | | - |
78 | 71 | - name: Handle cached Rust extensions |
79 | 72 | uses: actions/cache@v4 |
80 | 73 | id: rust-cache |
|
116 | 109 |
|
117 | 110 | - name: Install system deps |
118 | 111 | if: | |
119 | | - steps.cli-cache.outputs.cache-hit != 'true' || |
120 | 112 | steps.rust-cache.outputs.cache-hit != 'true' || |
121 | 113 | steps.ext-cache.outputs.cache-hit != 'true' || |
122 | 114 | steps.stolon-cache.outputs.cache-hit != 'true' || |
|
126 | 118 | sudo apt-get install -y uuid-dev libreadline-dev bison flex libprotobuf-c-dev |
127 | 119 |
|
128 | 120 | - name: Install Rust toolchain |
129 | | - if: | |
130 | | - steps.cli-cache.outputs.cache-hit != 'true' || |
131 | | - steps.rust-cache.outputs.cache-hit != 'true' |
| 121 | + if: steps.rust-cache.outputs.cache-hit != 'true' |
132 | 122 | uses: dsherret/rust-toolchain-file@v1 |
133 | 123 |
|
134 | | - # Build EdgeDB CLI |
135 | | - |
136 | | - - name: Handle EdgeDB CLI build cache |
137 | | - uses: actions/cache@v4 |
138 | | - if: steps.cli-cache.outputs.cache-hit != 'true' |
139 | | - with: |
140 | | - path: ${{ env.BUILD_TEMP }}/rust/cli |
141 | | - key: edb-cli-build-v7-${{ env.EDGEDBCLI_GIT_REV }} |
142 | | - restore-keys: | |
143 | | - edb-cli-build-v7- |
144 | | -
|
145 | | - - name: Build EdgeDB CLI |
146 | | - env: |
147 | | - CARGO_HOME: ${{ env.BUILD_TEMP }}/rust/cli/cargo_home |
148 | | - CACHE_HIT: ${{ steps.cli-cache.outputs.cache-hit }} |
149 | | - run: | |
150 | | - if [[ "$CACHE_HIT" == "true" ]]; then |
151 | | - cp -v build/cli/bin/gel edb/cli/gel |
152 | | - else |
153 | | - python setup.py -v build_cli |
154 | | - fi |
155 | | -
|
156 | 124 | # Build Rust extensions |
157 | 125 |
|
158 | 126 | - name: Handle Rust extensions build cache |
|
309 | 277 | else |
310 | 278 | find /usr/lib -type f -name 'lib*' -printf '%P %s\n' | sort | sha256sum | cut -d ' ' -f1 > shared-artifacts/lib_cache_key.txt |
311 | 279 | fi |
312 | | - python setup.py -q ci_helper --type cli > shared-artifacts/edgedbcli_git_rev.txt |
313 | 280 | python setup.py -q ci_helper --type rust >shared-artifacts/rust_cache_key.txt |
314 | 281 | python setup.py -q ci_helper --type ext >shared-artifacts/ext_cache_key.txt |
315 | 282 | python setup.py -q ci_helper --type parsers >shared-artifacts/parsers_cache_key.txt |
316 | 283 | python setup.py -q ci_helper --type postgres >shared-artifacts/postgres_git_rev.txt |
317 | 284 | python setup.py -q ci_helper --type libpg_query >shared-artifacts/libpg_query_git_rev.txt |
318 | 285 | echo 'f8cd94309eaccbfba5dea7835b88c78377608a37' >shared-artifacts/stolon_git_rev.txt |
319 | 286 | python setup.py -q ci_helper --type bootstrap >shared-artifacts/bootstrap_cache_key.txt |
320 | | - echo EDGEDBCLI_GIT_REV=$(cat shared-artifacts/edgedbcli_git_rev.txt) >> $GITHUB_ENV |
321 | 287 | echo POSTGRES_GIT_REV=$(cat shared-artifacts/postgres_git_rev.txt) >> $GITHUB_ENV |
322 | 288 | echo LIBPG_QUERY_GIT_REV=$(cat shared-artifacts/libpg_query_git_rev.txt) >> $GITHUB_ENV |
323 | 289 | echo STOLON_GIT_REV=$(cat shared-artifacts/stolon_git_rev.txt) >> $GITHUB_ENV |
|
350 | 316 |
|
351 | 317 | - name: Set environment variables |
352 | 318 | run: | |
353 | | - echo EDGEDBCLI_GIT_REV=$(cat shared-artifacts/edgedbcli_git_rev.txt) >> $GITHUB_ENV |
354 | 319 | echo POSTGRES_GIT_REV=$(cat shared-artifacts/postgres_git_rev.txt) >> $GITHUB_ENV |
355 | 320 | echo STOLON_GIT_REV=$(cat shared-artifacts/stolon_git_rev.txt) >> $GITHUB_ENV |
356 | 321 | echo BUILD_LIB=$(python setup.py -q ci_helper --type build_lib) >> $GITHUB_ENV |
357 | 322 | echo BUILD_TEMP=$(python setup.py -q ci_helper --type build_temp) >> $GITHUB_ENV |
358 | 323 |
|
359 | 324 | # Restore build cache |
360 | 325 |
|
361 | | - - name: Restore cached EdgeDB CLI binaries |
362 | | - uses: actions/cache@v4 |
363 | | - id: cli-cache |
364 | | - with: |
365 | | - path: build/cli |
366 | | - key: edb-cli-v4-${{ env.EDGEDBCLI_GIT_REV }} |
367 | | - |
368 | 326 | - name: Restore cached Rust extensions |
369 | 327 | uses: actions/cache@v4 |
370 | 328 | id: rust-cache |
|
409 | 367 |
|
410 | 368 | - name: Stop if we cannot retrieve the cache |
411 | 369 | if: | |
412 | | - steps.cli-cache.outputs.cache-hit != 'true' || |
413 | 370 | steps.rust-cache.outputs.cache-hit != 'true' || |
414 | 371 | steps.ext-cache.outputs.cache-hit != 'true' || |
415 | 372 | steps.parsers-cache.outputs.cache-hit != 'true' || |
|
422 | 379 |
|
423 | 380 | - name: Validate cached binaries |
424 | 381 | run: | |
425 | | - # Validate EdgeDB CLI |
426 | | - ./build/cli/bin/gel --version || exit 1 |
427 | | -
|
428 | 382 | # Validate Stolon |
429 | 383 | ./build/stolon/bin/stolon-sentinel --version || exit 1 |
430 | 384 | ./build/stolon/bin/stolon-keeper --version || exit 1 |
|
436 | 390 |
|
437 | 391 | - name: Restore cache into the source tree |
438 | 392 | run: | |
439 | | - cp -v build/cli/bin/gel edb/cli/edgedb |
440 | | - cp -v build/cli/bin/gel edb/cli/gel |
441 | 393 | rsync -av ./build/rust_extensions/edb/ ./edb/ |
442 | 394 | rsync -av ./build/extensions/edb/ ./edb/ |
443 | 395 | rsync -av ./build/lib/edb/ ./edb/ |
|
0 commit comments