Skip to content

Commit ef89e9e

Browse files
committed
Add book build to CI
1 parent 203ee92 commit ef89e9e

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/ci.yml

+38
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,41 @@ jobs:
4343
4444
- name: Test book
4545
run: mdbook test
46+
47+
book-build:
48+
runs-on: ubuntu-20.04
49+
steps:
50+
- uses: actions/checkout@v2
51+
52+
- name: Read .env
53+
id: mdbook-version
54+
run: |
55+
. ./.env
56+
echo "::set-output name=MDBOOK_VERSION::${MDBOOK_VERSION}"
57+
echo "::set-output name=MDBOOK_LINKCHECK_VERSION::${MDBOOK_LINKCHECK_VERSION}"
58+
echo "::set-output name=MDBOOK_TOC_VERSION::${MDBOOK_TOC_VERSION}"
59+
60+
- name: Cache binaries
61+
id: mdbook-cache
62+
uses: actions/cache@v2
63+
with:
64+
path: |
65+
~/.cargo/bin
66+
key: ${{ runner.os }}-${{ steps.mdbook-version.outputs.MDBOOK_VERSION }}--${{ steps.mdbook-version.outputs.DBOOK_LINKCHECK_VERSION }}--${{ steps.mdbook-version.outputs.MDBOOK_TOC_VERSION }}
67+
68+
- name: Install latest stable Rust toolchain
69+
if: steps.mdbook-cache.outputs.cache-hit != 'true'
70+
uses: actions-rs/toolchain@v1
71+
with:
72+
toolchain: stable
73+
override: true
74+
75+
- name: Install Dependencies
76+
if: steps.mdbook-cache.outputs.cache-hit != 'true'
77+
run: |
78+
cargo install mdbook --version ${{ steps.mdbook-version.outputs.MDBOOK_VERSION }}
79+
cargo install mdbook-linkcheck --version ${{ steps.mdbook-version.outputs.MDBOOK_LINKCHECK_VERSION }}
80+
cargo install mdbook-toc --version ${{ steps.mdbook-version.outputs.MDBOOK_TOC_VERSION }}
81+
82+
- name: Test book
83+
run: mdbook build

0 commit comments

Comments
 (0)