File tree Expand file tree Collapse file tree 1 file changed +79
-0
lines changed Expand file tree Collapse file tree 1 file changed +79
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Generate and Preview Rust Docs
2
+
3
+ on :
4
+ pull_request :
5
+ branches :
6
+ - main # Only generate docs for PRs targeting main
7
+ push :
8
+ branches :
9
+ - main
10
+ workflow_dispatch :
11
+
12
+ permissions :
13
+ contents : read
14
+
15
+ jobs :
16
+ generate-docs :
17
+ runs-on : ubuntu-latest
18
+
19
+ steps :
20
+ - name : Checkout
21
+ uses : actions/checkout@v4
22
+ with :
23
+ path : zephyr-rust-lang
24
+
25
+ - name : Set up Python
26
+ uses : actions/setup-python@v5
27
+ with :
28
+ python-version : 3.11
29
+
30
+ - name : Setup Zephyr project
31
+ uses : zephyrproject-rtos/action-zephyr-setup@v1
32
+ with :
33
+ app-path : zephyr-rust-lang
34
+ manifest-file-name : ci-manifest.yml
35
+ toolchains : arm-zephyr-eabi:riscv64-zephyr-elf
36
+
37
+ - name : Install Rust Targets
38
+ shell : bash
39
+ run : |
40
+ rustup target add thumbv7em-none-eabi
41
+ rustup target add thumbv7m-none-eabi
42
+
43
+ - name : Setup cargo build
44
+ working-directory : zephyr-rust-lang
45
+ run : |
46
+ # Must do full build
47
+ west build -b nrf52840dk/nrf52840 docgen
48
+
49
+ - name : Build Rust documentation
50
+ working-directory : zephyr-rust-lang/docgen
51
+ run : |
52
+ rm -rf .cargo
53
+ mkdir .cargo
54
+ cd .cargo
55
+ ln -s ../../build/rust/sample-cargo-config.toml config.toml
56
+ cd ..
57
+ cargo doc
58
+
59
+ - name : Upload artifact
60
+ uses : actions/upload-pages-artifact@v3
61
+ with :
62
+ path : zephyr-rust-lang/build/rust/target/thumbv7em-none-eabi/doc
63
+
64
+ deploy :
65
+ needs : generate-docs
66
+ permissions :
67
+ pages : write
68
+ id-token : write
69
+
70
+ environment :
71
+ name : github-pages
72
+ url : ${{ steps.deployment.outputs.page_url }}
73
+
74
+ runs-on : ubuntu-latest
75
+
76
+ steps :
77
+ - name : Deploy to GitHub Pages
78
+ id : deployment
79
+ uses : actions/deploy-pages@v4
You can’t perform that action at this time.
0 commit comments