-
Notifications
You must be signed in to change notification settings - Fork 4
122 lines (100 loc) · 2.8 KB
/
build-test.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
119
120
121
122
name: Build and test
on: push
jobs:
check:
name: cargo check
runs-on: ubuntu-latest
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
RUSTFLAGS: "-D warnings" # fail on warnings
steps:
- uses: actions/checkout@v4
- name: install rust toolchain
run: |
rustup show
- uses: Swatinem/rust-cache@v2
with:
shared-key: "build"
- name: cargo check --all-targets
run: |
cargo check --all-targets
# Sadly, `cargo build --locked` isn't enough to check that the lockfile
# is up to date, as it will happily run even if there are extra entries in
# there.
#
# It does, however, make sure that the file is not updated, which is quite
# unhelpful.
- name: ensure lockfile hasn't changed
run: |
if [[ -n "$(git status --porcelain Cargo.lock)" ]]; then
echo 'The Cargo.lock file was changed!'
git diff Cargo.lock
exit 1
fi
lint:
name: just lint
runs-on: ubuntu-latest
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
RUSTFLAGS: "-D warnings" # fail on warnings
steps:
- uses: actions/checkout@v4
- name: install just
uses: extractions/setup-just@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: install rust toolchain
run: |
rustup show
- uses: Swatinem/rust-cache@v2
with:
shared-key: "build"
- name: just lint
run: |
just lint
test:
name: just test
runs-on: ubuntu-latest
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
RUSTFLAGS: "-D warnings" # fail on warnings
steps:
- uses: actions/checkout@v4
- name: install just
uses: extractions/setup-just@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: install cargo nextest
uses: taiki-e/install-action@nextest
- name: install rust toolchain
run: |
rustup show
- uses: Swatinem/rust-cache@v2
with:
shared-key: "test"
- name: just test
run: |
just test
build-docs:
name: just build-docs
runs-on: ubuntu-latest
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
RUSTFLAGS: "-D warnings" # fail on warnings
steps:
- uses: actions/checkout@v4
- name: install just
uses: extractions/setup-just@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: install mdbook
uses: taiki-e/install-action@mdbook
- name: install rust toolchain
run: |
rustup show
- name: install mdbook-pagetoc
run: |
cargo install mdbook-pagetoc
- name: just build-docs
run: |
just build-docs