-
Notifications
You must be signed in to change notification settings - Fork 2
101 lines (95 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
91
92
93
94
95
96
97
98
99
100
101
name: CI
on: [push]
env:
API_KEY: ${{ secrets.API_KEY }}
RUST_BACKTRACE: 1
jobs:
ensure-api-key-set:
runs-on: ubuntu-latest
steps:
- if: ${{ env.API_KEY == '' }}
uses: actions/github-script@v3
with:
script: |
core.setFailed('API_KEY secret must be defined!')
checks:
runs-on: ubuntu-latest
needs: [ensure-api-key-set]
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v2
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all --check
- name: Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
- name: Docs
uses: actions-rs/cargo@v1
with:
command: doc
args: --no-deps --document-private-items --workspace
env:
RUSTDOCFLAGS: -D warnings
test:
name: Test os=${{matrix.os}} target=${{matrix.target}}
needs: [ensure-api-key-set]
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
target: [""]
include:
- os: ubuntu-latest
- os: windows-latest
- os: macos-latest
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
# - os: ubuntu-latest
# target: x86_64-unknown-linux-musl
# - os: windows-latest
# target: x86_64-pc-windows-gnu
# - os: ubuntu-latest
# target: aarch64-unknown-linux-gnu
# - os: ubuntu-latest
# target: aarch64-unknown-linux-musl
# - os: ubuntu-latest
# target: arm-unknown-linux-musleabi
# - os: ubuntu-latest
# target: armv7-unknown-linux-musleabi
# - os: ubuntu-latest
# target: armv7-unknown-linux-musleabihf
# - os: ubuntu-latest
# target: powerpc64le-unknown-linux-musl
# - os: ubuntu-latest
# target: riscv64gc-unknown-linux-musl
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- uses: Swatinem/rust-cache@v2
with:
key: "${{matrix.os}}-${{matrix.target}}"
- name: Native Test
uses: actions-rs/cargo@v1
if: ${{matrix.target == ''}}
with:
command: test
- name: Cross Test
uses: actions-rs/cargo@v1
if: ${{matrix.target}}
with:
use-cross: true
command: test
args: --target ${{matrix.target}}