-
Notifications
You must be signed in to change notification settings - Fork 16
88 lines (66 loc) · 1.91 KB
/
ci.yml
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
name: Continuous integration
on:
push:
branches:
- main
pull_request:
env:
RUST_BACKTRACE: full
RUSTC_WRAPPER: sccache
SCCACHE_CACHE_SIZE: 2G
SCCACHE_DIR: /home/runner/.cache/sccache
jobs:
test:
name: fmt + clippy + build + test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up cargo cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
~/.cargo
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-
- name: Set up sccache cache
uses: actions/cache@v3
continue-on-error: false
with:
path: |
${{ env.SCCACHE_DIR }}
key: ${{ runner.os }}-sccache-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-sccache-
- name: Install rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Install sccache (ubuntu-latest)
env:
LINK: https://github.com/mozilla/sccache/releases/download
SCCACHE_VERSION: v0.3.0
run: ./ci/install_sccache_linux.sh
- name: Start sccache server
run: ./ci/sccache_start_server.sh
- name: Run fmt
run: ./ci/cargo_fmt_check.sh
- name: Run clippy
run: ./ci/cargo_clippy.sh
- name: Run build
run: ./ci/cargo_build.sh
- name: Start minio
run: ./ci/minio_start.sh
- name: Run tests
run: ./ci/cargo_test.sh
- name: Stop minio
run: ./ci/minio_stop.sh
- name: Print sccache stats
run: ./ci/sccache_show_stats.sh
- name: Stop sccache server
run: ./ci/sccache_stop_server.sh