-
Notifications
You must be signed in to change notification settings - Fork 2
69 lines (59 loc) · 1.71 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
name: ci
on:
push:
branches:
- main
tags-ignore:
- v*
pull_request:
branches:
- main
schedule:
- cron: 0 4/12 * * *
workflow_dispatch:
inputs:
nightly:
description: Use latest nightly
required: true
type: boolean
jobs:
ci:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
- name: Install Rust toolchain
env:
nightly: ${{ (github.event.inputs.nightly == 'true' || github.event_name == 'schedule') && 'true' || '' }}
run: |
if [ -z $nightly ]; then
toolchain=$(grep channel rust-toolchain.toml | sed -r 's/channel = "(.*)"/\1/')
echo "installing toolchain $toolchain from rust-toolchain.toml"
else
toolchain='nightly'
echo "installing toolchain nightly"
echo "also setting RUSTUP_TOOLCHAIN to nightly"
echo "RUSTUP_TOOLCHAIN=nightly" >> "$GITHUB_ENV"
fi
rm /home/runner/.cargo/bin/rustfmt
rustup toolchain install $toolchain --profile minimal
rustup component add --toolchain $toolchain rustfmt
rustup component add --toolchain $toolchain clippy
- name: Install just
uses: taiki-e/install-action@v2
with:
tool: just
- name: Install protoc
uses: arduino/setup-protoc@v2
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Rust cache
uses: Swatinem/rust-cache@v2
- name: Build
run: just check
- name: Check code format
run: just fmt-check
- name: Run linter
run: just lint
- name: Run tests
run: just test