-
Notifications
You must be signed in to change notification settings - Fork 1.4k
118 lines (93 loc) Β· 2.55 KB
/
ci.yaml
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
defaults:
run:
shell: bash
env:
RUSTFLAGS: --deny warnings
LANGUAGES: de fr es pt ru zh ja ko fil ar hi it nl
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust Toolchain Components
uses: actions-rs/toolchain@v1
with:
override: true
toolchain: stable
- uses: Swatinem/rust-cache@v2
- uses: peaceiris/actions-mdbook@v2
with:
mdbook-version: latest
- name: Install mdbook-i18n-helpers
run: cargo install mdbook-i18n-helpers
- name: Install mdbook-linkcheck
run: |
mkdir -p mdbook-linkcheck
cd mdbook-linkcheck
wget https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/latest/download/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip
unzip mdbook-linkcheck.x86_64-unknown-linux-gnu.zip
chmod +x mdbook-linkcheck
pwd >> $GITHUB_PATH
- name: Build docs
run: mdbook build docs -d build
- name: Build all translations for docs
run: |
for lang in ${{ env.LANGUAGES }}; do
echo "::group::Building $lang translation"
MDBOOK_BOOK__LANGUAGE=$lang \
mdbook build docs -d build/$lang
mv docs/build/$lang/html docs/build/html/$lang
echo "::endgroup::"
done
- name: Deploy Pages
uses: peaceiris/actions-gh-pages@v4
if: github.ref == 'refs/heads/master'
with:
github_token: ${{secrets.GITHUB_TOKEN}}
publish_branch: gh-pages
publish_dir: docs/build/html
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Rust Toolchain Components
uses: actions-rs/toolchain@v1
with:
components: clippy, rustfmt
override: true
toolchain: stable
- uses: Swatinem/rust-cache@v2
- name: Clippy
run: cargo clippy --all --all-targets
- name: Format
run: cargo fmt --all -- --check
- name: Check for Forbidden Words
run: |
sudo apt-get install ripgrep
./bin/forbid
test:
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- name: Install Rust Toolchain Components
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- uses: Swatinem/rust-cache@v2
- name: Test
run: cargo test --all