Skip to content

Commit 414566a

Browse files
committed
workflow: Add a docs workflow
This workflow will build the docs for the zephyr crates for a single particular build, and publish them to GH pages. Signed-off-by: David Brown <[email protected]>
1 parent 83d0bdc commit 414566a

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

.github/workflows/docs.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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+
jobs:
13+
generate-docs:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: 3.11
24+
25+
- name: Setup Zephyr project
26+
uses: zephyrproject-rtos/action-zephyr-setup@v1
27+
with:
28+
# app-path: zephyr-rust-lang
29+
manifest-file-name: ci-manifest.yml
30+
toolchains: arm-zephyr-eabi
31+
32+
- name: Install Rust Targets
33+
shell: bash
34+
run: |
35+
rustup target add thumbv7em-none-eabi
36+
rustup target add thumbv7m-none-eabi
37+
38+
- name: Setup cargo build
39+
run: |
40+
west build -b nrf52840dk/nrf52840 --camek-only docgen
41+
find . -type d -ls
42+
43+
# - name: Build Rust documentation
44+
# run: cargo doc --no-deps
45+
46+
# - name: Deploy docs to GitHub Pages for pull requests
47+
# if: github.event_name == 'pull_request'
48+
# uses: peaceiris/actions-gh-pages@v3
49+
# with:
50+
# github_token: ${{ secrets.GITHUB_TOKEN }}
51+
# publish_dir: ./target/doc
52+
# publish_branch: gh-pages
53+
# publish_dir: ./target/doc
54+
# destination_dir: pr-${{ github.event.number }}
55+
#
56+
# - name: Deploy docs to GitHub Pages for push to main
57+
# if: github.event_name == 'push'
58+
# uses: peaceiris/actions-gh-pages@v3
59+
# with:
60+
# github_token: ${{ secrets.GITHUB_TOKEN }}
61+
# publish_dir: ./target/doc
62+
# publish_branch: gh-pages

0 commit comments

Comments
 (0)