-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathbuild.rcl
More file actions
67 lines (60 loc) · 1.75 KB
/
build.rcl
File metadata and controls
67 lines (60 loc) · 1.75 KB
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
// There are repetitive configuration files for CI and Rustup, we
// deduplicate this using RCL version 0.12.0. <https://github.com/ruuda/rcl>
// Rebuild the files by running `rcl build`.
// The minimum supported Rust version (MSRV).
let msrv = "1.40.0";
// All of the Rust versions that we want to test on CI.
// We pick the MSRV, beta, and some in between.
let rust_versions = [msrv, "1.60.0", "1.80.0", "beta"];
let banner = "# This file is generated from build.rcl.";
let gha_steps = rust_version => [
{ uses = "actions/checkout@v4.2.1" },
{
name = "Install toolchain",
run = f"rustup toolchain install {rust_version}",
},
{
name = "Install dependencies",
run = "sudo apt update && sudo apt install libasound2-dev pkg-config",
},
for cmd in ["Build", "Test"]:
{
name = cmd,
run = f"cargo +{rust_version} {cmd.to_lowercase()} --verbose",
},
];
let github_actions_config = {
name = "Build",
on = {
push = { branches = ["*"] },
pull_request = { branches = ["release"] },
},
env = {
CARGO_TERM_COLOR = "always",
DEBIAN_FRONTEND = "noninteractive",
},
jobs = {
for rust_version in rust_versions:
// Dots are not allowed in job names.
let job_name = f"rust_{rust_version.replace(" ", "_").replace(".", "_")}";
job_name: {
name = f"Rust {rust_version}",
runs-on = "ubuntu-latest",
steps = gha_steps(rust_version),
}
},
};
{
".github/workflows/build.yml": {
banner = banner,
format = "json",
contents = github_actions_config,
},
"rust-toolchain.toml": {
banner = banner,
format = "toml",
// For local development, we test with the MSRV by default, to not
// accidentally break things.
contents = { toolchain = { channel = msrv } },
},
}