This repository was archived by the owner on Dec 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
99 lines (91 loc) · 3.04 KB
/
docs.yml
File metadata and controls
99 lines (91 loc) · 3.04 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
name: 📖
on:
push:
pull_request:
branches: [main]
merge_group:
jobs:
build-docs:
name: Build docs
runs-on: ubuntu-latest
steps:
- name: Install LAPACK, OpenBLAS
run: sudo apt-get install -y libopenblas-dev liblapack-dev
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.14"
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: "nightly"
- name: Set up MPI
uses: mpi4py/setup-mpi@v1
with:
mpi: "mpich"
- uses: actions/checkout@v4
- name: Build Rust docs
run: RUSTDOCFLAGS="--html-in-header katex-header.html" cargo +nightly doc --no-deps -Zunstable-options -Zrustdoc-scrape-examples --all-features
- name: Make index page
run: echo "<html><head><meta http-equiv='refresh' content='0; URL=ndelement'></head></html>" > target/doc/index.html
- name: Set file permissions
run: |
rm target/doc/.lock
chmod -c -R +rX target/doc
- name: Install uv
run: pip install uv
- name: Make virtual environment
run: |
uv venv .venv
uv pip install pip
- name: Build Python docs
run: |
source .venv/bin/activate
cd python/docs
uv pip install -r requirements.txt
make html
- name: Move docs
run: |
mkdir doc
mv target/doc doc/rust
mv python/docs/_build/html doc/python
- name: Make index page
run: echo "<html><head><title>ndelement docs</title></head><body><center><a href='rust/ndelement'>Rust docs</a><br /><a href='python'>Python docs</a></center></body></html>" > doc/index.html
#- name: Setup Pages
# uses: actions/configure-pages@v3
# if: github.ref == 'refs/heads/main'
#- name: Upload artifact for docs
# uses: actions/upload-pages-artifact@v3
# with:
# path: 'doc'
# if: github.ref == 'refs/heads/main'
- name: Make redirect page
run: |
mkdir docs
mkdir docs/rust
mkdir docs/rust/ndelement
mkdir docs/python
echo "<html><head><meta http-equiv='refresh' content='0; URL=https://bempp.github.io/nd/rust/ndelement/'></head></html>" > docs/index.html
cp docs/index.html docs/rust/index.html
cp docs/index.html docs/rust/ndelement/index.html
cp docs/index.html docs/python/index.html
- name: Upload artifact for docs
uses: actions/upload-pages-artifact@v3
with:
path: 'docs'
if: github.ref == 'refs/heads/main'
deploy-docs:
name: Deploy docs to GitHub pages
runs-on: ubuntu-latest
needs:
- build-docs
if: github.ref == 'refs/heads/main'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:
- name: Deploy docs to GitHub Pages
uses: actions/deploy-pages@v4