Repository navigation
93 lines (75 loc) · 2.32 KB
/
Copy pathbook.yml
File metadata and controls
93 lines (75 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Book
on:
push:
branches: [ main ]
# Always run on commits
pull_request:
paths:
- '.github/workflows/book.yml'
- 'docs/**'
- 'mdbook/**'
- 'examples/**'
- 'linera-base/**'
- 'linera-sdk/**'
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
# We need all the intermediate libraries below
cache: false
# mdbook ignores the rust-toolchain in the repo so we make it the default.
- name: 'Set default toolchain'
run: |
rustup show active-toolchain | awk '{ print $1 }' | xargs rustup default
- name: 'Setup mdbook'
uses: peaceiris/actions-mdbook@v2
with:
mdbook-version: '0.4.48'
- name: 'Install Protoc'
uses: ./.github/actions/install-protoc
- name: 'Install mdbook linkcheck'
uses: taiki-e/cache-cargo-install-action@v2
with:
tool: mdbook-linkcheck@0.7.7
- name: 'Install mdbook mermaid'
uses: taiki-e/cache-cargo-install-action@v2
with:
tool: mdbook-mermaid@0.15.0
- name: 'Install mdbook admonish'
uses: taiki-e/cache-cargo-install-action@v2
with:
tool: mdbook-admonish@1.19.0
- name: 'Build mdbook'
run: |
cd mdbook
mdbook build
- name: 'Build the Linera SDK'
run: |
cargo clippy --locked -p linera-sdk --features test,wasmer
DUPLICATE_LIBS=(target/debug/deps/lib{serde,linera_sdk,async_graphql}-*)
cargo build --locked -p linera-sdk --features test,wasmer
# mdbook test wants only one library but build dependencies can create duplicates.
rm "${DUPLICATE_LIBS[@]}"
- name: 'Test mdbook'
run: |
cd mdbook
mdbook test -L ../target/debug/deps/
formatting:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: 'Setup Node'
uses: actions/setup-node@v3
with:
node-version: 16
- name: 'Install prettier'
run: npm install -g prettier
- name: 'Check formatting'
run: prettier --check docs/