Skip to content

Commit 203ee92

Browse files
committed
Adding CI
1 parent 98ab8cf commit 203ee92

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/ci.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Continuous Integration
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
8+
jobs:
9+
book-test:
10+
runs-on: ubuntu-20.04
11+
steps:
12+
- uses: actions/checkout@v2
13+
14+
- name: Read .env
15+
id: mdbook-version
16+
run: |
17+
. ./.env
18+
echo "::set-output name=MDBOOK_VERSION::${MDBOOK_VERSION}"
19+
echo "::set-output name=MDBOOK_LINKCHECK_VERSION::${MDBOOK_LINKCHECK_VERSION}"
20+
echo "::set-output name=MDBOOK_TOC_VERSION::${MDBOOK_TOC_VERSION}"
21+
22+
- name: Cache binaries
23+
id: mdbook-cache
24+
uses: actions/cache@v2
25+
with:
26+
path: |
27+
~/.cargo/bin
28+
key: ${{ runner.os }}-${{ steps.mdbook-version.outputs.MDBOOK_VERSION }}--${{ steps.mdbook-version.outputs.DBOOK_LINKCHECK_VERSION }}--${{ steps.mdbook-version.outputs.MDBOOK_TOC_VERSION }}
29+
30+
- name: Install latest stable Rust toolchain
31+
if: steps.mdbook-cache.outputs.cache-hit != 'true'
32+
uses: actions-rs/toolchain@v1
33+
with:
34+
toolchain: stable
35+
override: true
36+
37+
- name: Install Dependencies
38+
if: steps.mdbook-cache.outputs.cache-hit != 'true'
39+
run: |
40+
cargo install mdbook --version ${{ steps.mdbook-version.outputs.MDBOOK_VERSION }}
41+
cargo install mdbook-linkcheck --version ${{ steps.mdbook-version.outputs.MDBOOK_LINKCHECK_VERSION }}
42+
cargo install mdbook-toc --version ${{ steps.mdbook-version.outputs.MDBOOK_TOC_VERSION }}
43+
44+
- name: Test book
45+
run: mdbook test

0 commit comments

Comments
 (0)