-
Notifications
You must be signed in to change notification settings - Fork 12
51 lines (48 loc) · 1.27 KB
/
rust_PR.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
name: Rust
on:
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Prepare
run: |
sudo apt update
sudo apt install ccache llvm autoconf2.13 automake clang -y
- name: Cache cargo registry
uses: actions/cache@v2
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.toml') }}
- name: Cache cargo index
uses: actions/cache@v2
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.toml') }}
- name: Ccache
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{ runner.OS }}-ccache-${{ hashFiles('**\Cargo.toml') }}
- name: Build
run: |
export SHELL=/bin/bash
export CC=/usr/bin/clang
export CXX=/usr/bin/clang++
ccache -z
CCACHE=$(which ccache) cargo build --verbose
ccache -s
- name: Run tests
run: cargo test --verbose
- name: Format
run: |
cargo fmt --all -- --check
- name: Clippy check
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}