-
Notifications
You must be signed in to change notification settings - Fork 9
104 lines (86 loc) · 3.13 KB
/
Copy pathdocs.yml
File metadata and controls
104 lines (86 loc) · 3.13 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
name: Deploy Documentation
on:
push:
branches: [ main ]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
- name: Install mdBook
run: |
mkdir -p "$HOME/bin"
curl -fLsS https://github.com/rust-lang/mdBook/releases/download/v0.5.2/mdbook-v0.5.2-x86_64-unknown-linux-gnu.tar.gz -o mdbook.tar.gz
echo '084e4342ba564db270108763e404a7d1f309d932651a22484e93c0dc1a071f6d mdbook.tar.gz' | sha256sum --check
tar -xzf mdbook.tar.gz -C "$HOME/bin"
echo "$HOME/bin" >> $GITHUB_PATH
- name: Install Typst
run: |
curl -fLsS https://github.com/typst/typst/releases/download/v0.15.1/typst-x86_64-unknown-linux-musl.tar.xz -o typst.tar.xz
echo 'a6d077d0a95eed5a2eba715b2dae06be954f624ccbf85758a03f389ded33118c typst.tar.xz' | sha256sum --check
tar -xJf typst.tar.xz
mv typst-x86_64-unknown-linux-musl/typst "$HOME/bin/"
- name: Install Node dependencies
run: npm ci
- name: Generate data
run: |
cargo run --features "example-db" --example export_examples
cargo run --example export_petersen_mapping
cargo run --example export_graph
node scripts/generate_reduction_graph_layout.js
cargo run --example export_schemas
cargo build -p problemreductions-cli --bin pred
bash scripts/generate_doc_snippets.sh target/debug/pred
- name: Build mdBook
run: mdbook build
- name: Build PDF
run: typst compile --root . docs/paper/reductions.typ book/reductions.pdf
- name: Build rustdoc
run: RUSTDOCFLAGS="--default-theme=dark" cargo doc --no-deps
- name: Combine documentation
run: |
mkdir -p book/api
cp -r target/doc/* book/api/
- name: Build research website
run: python3 scripts/build_website.py
- name: Verify deployment artifact
run: |
python3 -m pip install playwright==1.58.0
python3 -m playwright install --with-deps chromium
npm audit --audit-level=moderate
npm run test:reduction-graph-js
python3 -m unittest discover -s scripts -p 'test_website_build.py'
python3 -m http.server 3001 --bind 127.0.0.1 --directory book &
server_pid=$!
trap 'kill "$server_pid"' EXIT
python3 scripts/test_website.py
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './book'
deploy:
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4