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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: CI (Linux)
on:
push:
pull_request:
schedule:
jobs:
build_and_test:
strategy:
fail-fast: false
matrix:
version:
- stable
- nightly
name: ${{ matrix.version }} - x86_64-unknown-linux-gnu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install ${{ matrix.version }}
run: |
rustup toolchain install ${{ matrix.version }} --profile minimal --component rustfmt
rustup default ${{ matrix.version }}
- name: Generate Cargo.lock
run: cargo generate-lockfile
- name: Cache cargo registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ matrix.version }}-x86_64-unknown-linux-gnu-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Run tests
timeout-minutes: 40
run: cargo test --all-features -- --nocapture
- name: Run tests no-std
timeout-minutes: 40
run: cargo test --no-default-features -- --nocapture
- name: Install cargo-cache
continue-on-error: true
run: |
cargo install cargo-cache --no-default-features --features ci-autoclean
- name: Clear the cargo caches
run: |
cargo-cache
build_cross:
strategy:
fail-fast: false
matrix:
target:
- aarch64-unknown-linux-gnu
- riscv64gc-unknown-linux-gnu
- powerpc64-unknown-linux-gnu
name: build - ${{ matrix.target }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install stable
run: |
rustup toolchain install stable --profile minimal
rustup default stable
rustup target add ${{ matrix.target }}
- name: Generate Cargo.lock
run: cargo generate-lockfile
- name: Cache cargo registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ matrix.target }}-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ matrix.target }}-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: cargo build --target ${{ matrix.target }} --all-features
- name: Build no-std
run: cargo build --target ${{ matrix.target }} --no-default-features