-
Notifications
You must be signed in to change notification settings - Fork 36
50 lines (47 loc) · 1.19 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
name: CI
on:
pull_request:
branches:
- master
push:
branches:
- master
env:
RUSTFLAGS: -D warnings
RUST_BACKTRACE: 1
jobs:
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: |
rustup update --no-self-update stable
rustup default stable
- name: Get Rust version
id: rust-version
run: echo "::set-output name=version:$(rustc --version)"
- name: Index cache
uses: actions/cache@v3
with:
path: ~/.cargo/registry/index
key: index-${{ github.run_id }}
restore-keys: |
index-
- name: Create lockfile
run: cargo generate-lockfile
- name: Registry cache
uses: actions/cache@v3
with:
path: ~/.cargo/registry/cache
key: registry-${{ hashFiles('Cargo.lock') }}
- name: Fetch dependencies
run: cargo fetch
- name: Target cache
uses: actions/cache@v3
with:
path: target
key: target-${{ steps.rust-version.outputs.version }}-${{ hashFiles('Cargo.lock') }}
- name: Test
run: cargo test