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
name: CI
on:
jobs:
build_and_test:
name: Build and Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# - name: Find latest rust stable version
# id: rust_stable_version
# run: |
# VER=$(curl -s https://static.rust-lang.org/dist/channel-rust-stable.toml | grep -A 1 "\[pkg\.rust\]" | grep version | sed -r 's/.*\"(.*)\".*/\1/')
# echo "$VER"
# echo "##[set-output name=rustc;]$VER"
# - name: Cache rust toolchain
# id: cache_rust_toolchain
# uses: actions/cache@v1
# with:
# key: ${{ steps.rust_stable_version.outputs.rustc }}
# path: "~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/"
- name: Install stable toolchain
if: steps.cache_rust_toolchain.output.cache-hit != 'true'
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt, clippy
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
miri:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: miri, rust-src
- uses: actions-rs/cargo@v1
with:
command: miri
args: setup
- uses: actions-rs/cargo@v1
with:
command: miri
args: test --all-features