-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (80 loc) · 2.73 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
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
on: [push, pull_request]
name: CI
jobs:
clippy:
name: Clippy
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
components: clippy
- name: cargo clippy
uses: actions-rs/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
test:
name: Test
runs-on: ubuntu-20.04
timeout-minutes: 10
strategy:
matrix:
toolchain:
- "" # default
target:
- ""
- "riscv64imac-unknown-none-elf"
- "riscv32i-unknown-none-elf"
- "thumbv6m-none-eabi"
features:
- ""
- "alloc"
- "std"
- "unstable"
- "alloc,unstable"
- "std,unstable"
exclude:
- { target: "riscv64imac-unknown-none-elf", features: "std" }
- { target: "riscv64imac-unknown-none-elf", features: "std,unstable" }
- { target: "riscv32i-unknown-none-elf", features: "std" }
- { target: "riscv32i-unknown-none-elf", features: "std,unstable" }
- { target: "thumbv6m-none-eabi", features: "std" }
- { target: "thumbv6m-none-eabi", features: "std,unstable" }
include:
# older toolchains
- { toolchain: "1.54.0", features: "std,unstable" }
- { toolchain: "1.60.0", features: "std,unstable" }
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Change the target toolchain
if: ${{ matrix.toolchain != '' }}
run: |
echo ${{ matrix.toolchain }} > rust-toolchain
- uses: actions-rs/toolchain@v1
with:
profile: minimal
# No-`std` target is needed to really test `no_std`
- name: Install the target standard library
if: ${{ matrix.target != '' }}
run: |
rustup target add ${{ matrix.target }}
- name: Derive `--target` parameter
if: ${{ matrix.target != '' }}
run: echo "target_param=--target ${{ matrix.target }}" >> $GITHUB_ENV
- name: Skip doctests if `not(feature = "std")`
if: ${{ !startsWith(matrix.features, 'std') }}
run: echo "test_param=--lib" >> $GITHUB_ENV
- name: cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: -p tokenlock ${{ env.target_param }} --no-default-features --features "${{ matrix.features }}"
- name: cargo test
uses: actions-rs/cargo@v1
if: ${{ matrix.target == '' }}
with:
command: test
args: -p tokenlock ${{ env.target_param }} --no-default-features --features "${{ matrix.features }}" ${{ env.test_param }}