-
-
Notifications
You must be signed in to change notification settings - Fork 7
161 lines (139 loc) · 4.05 KB
/
build.yaml
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: Build
concurrency:
group: build-${{ github.head_ref }}
cancel-in-progress: true
env:
CARGO_INCREMENTAL: 0
on:
push:
branches: ["**"]
tags-ignore: ["**"]
paths-ignore:
- "**.md"
- LICENSE-Apache
- LICENSE-MIT
pull_request:
paths-ignore:
- "**.md"
- "**/LICENSE-Apache"
- "**/LICENSE-MIT"
- .github/FUNDING.yml
- .editorconfig
- .gitignore
jobs:
check:
name: Type checking (${{ matrix.target.name }})
runs-on: ${{ matrix.target.host }}
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) || github.event_name == 'push' }}
strategy:
matrix:
target:
# name: Windows
# triple: x86_64-pc-windows-gnu
- name: Linux
triple: x86_64-unknown-linux-gnu
host: ubuntu-latest
- name: Android
triple: aarch64-linux-android
host: ubuntu-latest
- name: macOS
triple: x86_64-apple-darwin
host: macos-latest
- name: iOS
triple: aarch64-apple-ios
host: macos-latest
- name: FreeBSD
triple: x86_64-unknown-freebsd
host: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.54.0
target: ${{ matrix.target.triple }}
override: true
- name: Cache cargo output
uses: Swatinem/rust-cache@v1
with:
key: ${{ matrix.target.triple }}
- name: Type checking
uses: actions-rs/cargo@v1
with:
command: check
args: --target ${{ matrix.target.triple }}
test:
name: Test (${{ matrix.target.name}})
runs-on: ${{ matrix.target.host }}
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) || github.event_name == 'push' }}
strategy:
matrix:
target:
# name: Windows
# host: windows-latest
# triple: x86_64-pc-windows-gnu
- name: Linux
host: ubuntu-latest
triple: x86_64-unknown-linux-gnu
- name: macOS
host: macos-latest
triple: x86_64-apple-darwin
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: ${{ matrix.target.triple }}
override: true
- name: Cache cargo output
uses: Swatinem/rust-cache@v1
with:
key: ${{ matrix.target.triple }}
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: -- --test-threads=1
fmt:
name: Formatting
runs-on: ubuntu-20.04
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) || github.event_name == 'push' }}
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt
- name: Check formatting
uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check
clippy:
name: Clippy
runs-on: ubuntu-20.04
if: ${{ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) || github.event_name == 'push' }}
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Cache cargo output
uses: Swatinem/rust-cache@v1
- name: Run clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}