-
Notifications
You must be signed in to change notification settings - Fork 15
57 lines (50 loc) · 1.62 KB
/
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
52
53
54
55
56
name: Check and Test
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- version: 1.80.1
integration-tests: true
- version: 1.58.1
integration-tests: false
steps:
- uses: actions/checkout@v2
- name: Cache Cargo
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ matrix.rust.version }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ matrix.rust.version }}-cargo-
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain stable -y
source $HOME/.cargo/env
rustup update ${{ matrix.rust.version }} --no-self-update
rustup default ${{ matrix.rust.version }}
- name: Check lib
run: |
$HOME/.cargo/bin/cargo check --all-targets --no-default-features
$HOME/.cargo/bin/cargo check --all-targets
$HOME/.cargo/bin/cargo clippy --all-targets
$HOME/.cargo/bin/cargo fmt --check
$HOME/.cargo/bin/cargo test
env:
RUST_BACKTRACE: 1
- name: Check integration tests
run: |
pushd integration_tests
$HOME/.cargo/bin/cargo check --all-targets
$HOME/.cargo/bin/cargo clippy --all-targets
$HOME/.cargo/bin/cargo fmt --check
$HOME/.cargo/bin/cargo test
popd
if: ${{ matrix.rust.integration-tests }}
env:
RUST_BACKTRACE: 1