@@ -16,8 +16,48 @@ concurrency:
16
16
cancel-in-progress : true
17
17
18
18
jobs :
19
+ build-corelib-docs :
20
+ runs-on : ubuntu-latest
21
+ env :
22
+ MDBOOK_VERSION : 0.4.31
23
+ steps :
24
+ - uses : actions/checkout@v4
25
+ - uses : dtolnay/rust-toolchain@stable
26
+ - uses : Swatinem/rust-cache@v2
27
+ - name : Install mdBook
28
+ run : cargo install --version ${MDBOOK_VERSION} mdbook
29
+ - uses : software-mansion/setup-scarb@v1
30
+ - name : Init Scarb to cache corelib
31
+ id : scarb-init
32
+ run : |
33
+ mkdir -p $HOME/pkg
34
+ pushd $HOME/pkg
35
+ scarb init --no-vcs
36
+ echo "CORELIB_PATH=$(scarb metadata --format-version 1 | jq -r '.packages[] | select(.name == "core") | .root')" >> $GITHUB_OUTPUT
37
+ env :
38
+ SCARB_INIT_TEST_RUNNER : cairo-test
39
+ - name : Extract corelib from Scarb cache
40
+ run : |
41
+ mkdir -p core
42
+ cp -r ${{ steps.scarb-init.outputs.CORELIB_PATH }}/* ./core
43
+ - name : Generate and build corelib docs
44
+ run : |
45
+ scarb doc --all-features
46
+ pushd target/doc/core
47
+ mdbook build
48
+ working-directory : ./core
49
+ - name : Apply custom highlighting
50
+ run : |
51
+ curl -o highlight.js https://raw.githubusercontent.com/software-mansion/scarb/main/extensions/scarb-doc/theme/highlight.js
52
+ cp highlight.js ./core/target/doc/core/highlight.js
53
+ - uses : actions/upload-artifact@v4
54
+ with :
55
+ name : corelib-docs
56
+ path : ./core/target/doc/core/book
57
+
19
58
build :
20
59
runs-on : ubuntu-latest
60
+ needs : build-corelib-docs
21
61
defaults :
22
62
run :
23
63
working-directory : ./website
32
72
- uses : actions/configure-pages@v5
33
73
- run : npm ci
34
74
- run : npm run build
75
+ - uses : actions/download-artifact@v4
76
+ with :
77
+ name : corelib-docs
78
+ path : website/.vitepress/dist/corelib
35
79
- name : Upload GitHub Pages artifact
36
80
uses : actions/upload-pages-artifact@v3
37
81
with :
0 commit comments