forked from rhaiscript/rhai
-
Notifications
You must be signed in to change notification settings - Fork 3
200 lines (192 loc) · 6.95 KB
/
build.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
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
name: Build
on:
push:
branches:
- main
- master
- fix
pull_request: {}
env:
RUST_MSRV: 1.66.0
jobs:
msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v1
with:
path: |
~/.cargo/bin
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db/
target
key: "${{ runner.os }}-cargo-build-msrv-${{ hashFiles('**/Cargo.lock') }}"
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_MSRV }}
override: true
- uses: actions-rs/cargo@v1
with:
command: check
args: "--features decimal,metadata,serde,debugging"
# typical build with various feature combinations
build:
name: Build
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
os: [ubuntu-latest]
flags:
- ""
- "--features testing-environ,debugging"
- "--features testing-environ,metadata"
- "--features testing-environ,serde"
- "--features testing-environ,decimal"
- "--features testing-environ,no_float,decimal"
- "--features testing-environ,unicode-xid-ident"
- "--features testing-environ,internals"
- "--features testing-environ,decimal,serde,metadata,internals,debugging"
- "--features testing-environ,unchecked,serde,metadata,internals,debugging"
- "--features testing-environ,sync,serde,metadata,internals,debugging"
- "--features testing-environ,no_position,serde,metadata,internals,debugging"
- "--features testing-environ,no_optimize,serde,metadata,internals,debugging"
- "--features testing-environ,no_float,serde,metadata,internals,debugging"
- "--features testing-environ,f32_float,serde,metadata,internals,debugging"
- "--features testing-environ,no_custom_syntax,serde,metadata,internals,debugging"
- "--tests --features testing-environ,only_i32,serde,metadata,internals,debugging"
- "--features testing-environ,only_i64,serde,metadata,internals,debugging"
- "--features testing-environ,no_index,serde,metadata,internals,debugging"
- "--features testing-environ,no_object,serde,metadata,internals,debugging"
- "--features testing-environ,no_function,serde,metadata,internals,debugging"
- "--features testing-environ,no_module,serde,metadata,internals,debugging"
- "--features testing-environ,no_time,serde,metadata,internals,debugging"
- "--features testing-environ,no_closure,serde,metadata,internals,debugging"
- "--features testing-environ,sync,no_time,no_function,no_float,no_position,no_optimize,no_module,no_closure,no_custom_syntax,metadata,serde,unchecked,debugging"
- "--features testing-environ,no_time,no_function,no_float,no_position,no_index,no_object,no_optimize,no_module,no_closure,no_custom_syntax,unchecked"
toolchain: [stable]
experimental: [false]
include:
# smoketests for different toolchains
- {toolchain: stable, os: windows-latest, experimental: false, flags: ""}
- {toolchain: stable, os: macos-latest, experimental: false, flags: ""}
- {toolchain: beta, os: ubuntu-latest, experimental: false, flags: "--features unstable"}
- {toolchain: nightly, os: ubuntu-latest, experimental: true, flags: "--features unstable"}
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{matrix.toolchain}}
override: true
- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: ${{matrix.flags}}
# no-std builds are a bit more extensive to test
no_std_build:
name: NoStdBuild
runs-on: ${{matrix.os}}
continue-on-error: ${{matrix.experimental}}
strategy:
matrix:
include:
- {os: ubuntu-latest, flags: "--profile unix", experimental: false}
- {os: windows-latest, flags: "--profile windows", experimental: true}
#- {os: macos-latest, flags: "--profile macos", experimental: false}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- name: Build Project
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path=no_std/no_std_test/Cargo.toml ${{matrix.flags}}
wasm:
name: Check Wasm build
runs-on: ubuntu-latest
strategy:
matrix:
flags:
- "--target wasm32-wasi"
# These fail currently, future PR should fix them
# - "--target wasm32-unknown-unknown"
# - "--target wasm32-unknown-unknown --features wasm-bindgen"
- "--target wasm32-unknown-unknown --no-default-features"
- "--target wasm32-unknown-unknown --no-default-features --features wasm-bindgen"
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Generic Wasm Toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
target: wasm32-unknown-unknown
- name: Setup Wasi Toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
target: wasm32-wasi
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: ${{matrix.flags}}
rustfmt:
name: Check Formatting
runs-on: windows-latest
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt, clippy
- name: Run Rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Run Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all -- -Aclippy::all -Dclippy::perf
codegen_build:
name: Codegen Build
runs-on: ${{matrix.os}}
continue-on-error: ${{matrix.experimental}}
strategy:
matrix:
include:
- {toolchain: stable, os: ubuntu-latest, experimental: false, flags: "--features metadata"}
- {toolchain: stable, os: windows-latest, experimental: false, flags: "--features metadata"}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{matrix.toolchain}}
override: true
- name: Build Project
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path=codegen/Cargo.toml ${{matrix.flags}}