Skip to content

Commit

Permalink
Merge pull request automerge#384 from jeffa5/serve-c-docs
Browse files Browse the repository at this point in the history
Build c docs in CI
  • Loading branch information
Andrew Jeffery authored Jun 6, 2022
2 parents cf264f3 + 5c1cbc8 commit 97ef4fe
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,38 @@ jobs:
uses: Swatinem/rust-cache@v1

- name: Clean docs dir
run: rm -rf docs
shell: bash

- name: Clean Rust docs dir
uses: actions-rs/cargo@v1
with:
command: clean
args: --doc

- name: Build docs
- name: Build Rust docs
uses: actions-rs/cargo@v1
with:
command: doc
args: --workspace --all-features --no-deps

- name: Move Rust docs
run: mkdir -p docs && mv target/doc/* docs/.
shell: bash

- name: Build C docs
run: ./scripts/ci/cmake-docs
shell: bash

- name: Move C docs
run: mkdir -p docs/automerge-c && mv automerge-c/build/src/html docs/automerge-c
shell: bash

- name: Configure root page
run: echo '<meta http-equiv="refresh" content="0; url=automerge">' > target/doc/index.html

- name: Deploy docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./target/doc
publish_dir: ./docs
2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@
nodejs
yarn

# c deps
cmake
cmocka
doxygen

rnix-lsp
nixpkgs-fmt
Expand Down
10 changes: 10 additions & 0 deletions scripts/ci/cmake-docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

set -eoux pipefail

cmake -E make_directory automerge-c/build
cd automerge-c/build
cmake -B . -S ..
cmake --build . --target automerge_docs

echo "Try opening automerge-c/build/src/html/index.html"
1 change: 1 addition & 0 deletions scripts/ci/run
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ set -eou pipefail
./scripts/ci/wasm_tests
./scripts/ci/js_tests
./scripts/ci/cmake-build Release static
./scripts/ci/cmake-docs

0 comments on commit 97ef4fe

Please sign in to comment.