Skip to content

Commit cc330ce

Browse files
authored
Add nightly CI for documentation builds (#231)
Closes #228 and possibly also #219 Needs a release of bloqade-circuit v0.2.0 first as it also updates the examples to work with the new version. Also, I'm checking the versions / commit hashes for the nightly builds and cancel the jobs if nothing has changed. To do this, I'm using github variables. Not sure if this is the best solution. If it is, then we'd need to create the variables (the body can be empty to start with). There are probably permission issues then as well since I don't think the `GH_TOKEN` has permissions to set github variables and cancel jobs. @Roger-luo @weinbe58 do you know a better solution for this?
1 parent 756deda commit cc330ce

File tree

4 files changed

+104
-4
lines changed

4 files changed

+104
-4
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# This workflow pulls in the latest main branches of dependent packages and tries to build the documentation
2+
# so we can stay on top of issues with the examples when introducing changes
3+
name: Documentation
4+
on:
5+
schedule:
6+
- cron: 24 4 * * *
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.headref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
documentation:
13+
name: Build documentation
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v6
19+
with:
20+
# Install a specific version of uv.
21+
version: "0.5.1"
22+
enable-cache: true
23+
cache-dependency-glob: "uv.lock"
24+
- name: Install Documentation dependencies
25+
run: uv sync --group doc
26+
27+
# get latest dependencies from git directly
28+
- name: clone the latest bloqade-circuit
29+
id: clone_bloqade_circuit
30+
uses: actions/checkout@v4
31+
with:
32+
repository: https://github.com/QuEraComputing/bloqade-circuit
33+
path: '../bloqade-circuit'
34+
35+
- name: clone the latest bloqade-analog
36+
id: clone_bloqade_analog
37+
uses: actions/checkout@v4
38+
with:
39+
repository: https://github.com/QuEraComputing/bloqade-analog
40+
path: '../bloqade-analog'
41+
42+
- name: add local repos as dependencies
43+
run: uv add ../bloqade-circuit ../bloqade-analog
44+
45+
- name: Set up build cache
46+
uses: actions/cache@v4
47+
id: cache
48+
with:
49+
key: mkdocs-material-nightly-dev-${{ github.headref }}
50+
path: .cache
51+
restore-keys: |
52+
mkdocs-material-
53+
- name: Build documentation
54+
env:
55+
EXECUTE_NOTEBOOKS: "true"
56+
run: |
57+
uv run mkdocs build

.github/workflows/doc-nightly.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# This workflow builds & deploys the documentation using the latest release versions of dependent packages
2+
# Main use is to detect issues / accidental breaking changes with patch releases of e.g. bloqade-circuit
3+
name: Documentation
4+
on:
5+
schedule:
6+
- cron: 12 4 * * 0
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.headref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
documentation:
13+
name: Build documentation
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v6
19+
with:
20+
# Install a specific version of uv.
21+
version: "0.5.1"
22+
enable-cache: true
23+
cache-dependency-glob: "uv.lock"
24+
- name: Install Documentation dependencies
25+
run: uv sync --group doc
26+
27+
- name: Set up build cache
28+
uses: actions/cache@v4
29+
id: cache
30+
with:
31+
key: mkdocs-material-nightly-${{ github.headref }}
32+
path: .cache
33+
restore-keys: |
34+
mkdocs-material-
35+
- name: Build documentation
36+
env:
37+
EXECUTE_NOTEBOOKS: "true"
38+
run: |
39+
uv run mkdocs build

_typos.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ AttributeIDSupressMenu = "AttributeIDSupressMenu"
1212
Braket = "Braket"
1313
mch = "mch"
1414
IY = "IY"
15+
16+
[files]
17+
extend-exclude = [".github/workflows/*"]

justfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ coverage-open:
1515

1616
coverage: coverage-run coverage-xml coverage-report
1717

18-
doc:
19-
mkdocs serve
18+
doc FLAGS="":
19+
mkdocs serve {{FLAGS}}
20+
21+
doc-build FLAGS="":
22+
mkdocs build {{FLAGS}}
2023

21-
doc-build:
22-
mkdocs build

0 commit comments

Comments
 (0)