Skip to content

Commit 6c9a055

Browse files
authored
Added a matrix of 4 targets for CI builds (#70)
1 parent f736079 commit 6c9a055

File tree

2 files changed

+53
-33
lines changed

2 files changed

+53
-33
lines changed

.github/workflows/ci.yaml

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,49 +7,44 @@ on:
77
jobs:
88
ci:
99
name: Format, lint, and test
10-
runs-on: ubuntu-18.04
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
include:
14+
- os: ubuntu-18.04
15+
binary_target: x86_64-unknown-linux-musl
16+
needs_musl: true
17+
- os: ubuntu-18.04
18+
binary_target: x86_64-unknown-linux-gnu
19+
- os: macos-10.15
20+
binary_target: x86_64-apple-darwin
21+
- os: windows-2019
22+
binary_target: x86_64-pc-windows-msvc
1123
steps:
1224
- uses: actions/checkout@v2
1325
with:
1426
submodules: recursive
1527
- uses: davidB/rust-cargo-make@v1
1628

17-
- uses: actions-rs/toolchain@v1
18-
with:
19-
toolchain: stable
20-
profile: minimal
21-
override: true
22-
23-
- name: Set up Makefile.toml
29+
- name: Install musl tools
30+
if: matrix.needs_musl
2431
run: |
25-
cat >Makefile.toml <<EOF
26-
[env]
27-
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
28-
CARGO_MAKE_RUN_CLIPPY = true
29-
CARGO_MAKE_CLIPPY_ARGS = "--all-features -- -D warnings"
30-
CARGO_MAKE_RUN_CHECK_FORMAT = true
31-
RUSTFLAGS="-D warnings"
32+
sudo apt-get install musl-tools
33+
sudo ln -s /usr/bin/musl-gcc /usr/bin/musl-g++
3234
33-
[tasks.check-format-ci-flow]
34-
condition = { env_set = [
35-
"CARGO_MAKE_RUN_CHECK_FORMAT",
36-
], channels = [
37-
"stable",
38-
], platforms = [
39-
"linux",
40-
] }
35+
- name: Install LLVM and Clang # required for bindgen on Windows
36+
uses: KyleMayes/install-llvm-action@v1
37+
if: matrix.os == 'windows-2019'
38+
with:
39+
version: "10.0"
4140

42-
[tasks.clippy-ci-flow]
43-
condition = { env_set = [
44-
"CARGO_MAKE_RUN_CLIPPY",
45-
], channels = [
46-
"stable",
47-
], platforms = [
48-
"linux",
49-
] }
50-
EOF
41+
- name: Install rust ${{ matrix.binary_target }}
42+
uses: actions-rs/toolchain@v1
43+
with:
44+
toolchain: stable-${{ matrix.binary_target }}
45+
profile: minimal
5146

5247
- uses: actions-rs/cargo@v1
5348
with:
5449
command: make
55-
args: --no-workspace workspace-ci-flow
50+
args: --makefile ci-makefile.toml --no-workspace workspace-ci-flow

ci-makefile.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[env]
2+
CARGO_MAKE_RELEASE_FLOW_TARGET = "${{ matrix.binary_target }}"
3+
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
4+
CARGO_MAKE_RUN_CLIPPY = true
5+
CARGO_MAKE_CLIPPY_ARGS = "--all-features -- -D warnings"
6+
CARGO_MAKE_RUN_CHECK_FORMAT = true
7+
RUSTFLAGS="-D warnings"
8+
9+
[tasks.check-format-ci-flow]
10+
condition = { env_set = [
11+
"CARGO_MAKE_RUN_CHECK_FORMAT",
12+
], channels = [
13+
"stable",
14+
], platforms = [
15+
"linux",
16+
] }
17+
18+
[tasks.clippy-ci-flow]
19+
condition = { env_set = [
20+
"CARGO_MAKE_RUN_CLIPPY",
21+
], channels = [
22+
"stable",
23+
], platforms = [
24+
"linux",
25+
] }

0 commit comments

Comments
 (0)