Skip to content

Commit b73a368

Browse files
authored
ci: Fix cross builds in the CI (#120)
1 parent 3a9b38b commit b73a368

File tree

2 files changed

+71
-14
lines changed

2 files changed

+71
-14
lines changed

.cirrus.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
only_if: $CIRRUS_TAG == '' && ($CIRRUS_PR != '' || $CIRRUS_BRANCH == 'master')
2+
auto_cancellation: $CIRRUS_BRANCH != 'master'
3+
env:
4+
CARGO_INCREMENTAL: '0'
5+
CARGO_NET_GIT_FETCH_WITH_CLI: 'true'
6+
CARGO_NET_RETRY: '10'
7+
CARGO_TERM_COLOR: always
8+
RUST_BACKTRACE: '1'
9+
RUSTDOCFLAGS: -D warnings
10+
RUSTFLAGS: -D warnings
11+
RUSTUP_MAX_RETRIES: '10'
12+
13+
freebsd_task:
14+
name: test ($TARGET)
15+
freebsd_instance:
16+
image_family: freebsd-12-4
17+
matrix:
18+
- env:
19+
TARGET: x86_64-unknown-freebsd
20+
- env:
21+
TARGET: i686-unknown-freebsd
22+
setup_script:
23+
# https://github.com/cirruslabs/cirrus-ci-docs/issues/483
24+
- sudo sysctl net.inet.tcp.blackhole=0
25+
- pkg install -y git
26+
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable --target $TARGET
27+
test_script:
28+
- . $HOME/.cargo/env
29+
- cargo test --target $TARGET

.github/workflows/ci.yml

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -78,36 +78,64 @@ jobs:
7878
- name: Install Rust
7979
run: rustup update stable
8080
- name: Install cross
81-
uses: taiki-e/install-action@v2
82-
with:
83-
# https://github.com/cross-rs/cross/issues/724
84-
81+
uses: taiki-e/install-action@cross
82+
# We don't test BSDs, since we already test them in Cirrus/vmactions.
8583
- name: Android
8684
if: startsWith(matrix.os, 'ubuntu')
8785
run: cross test --target arm-linux-androideabi
88-
- name: NetBSD
89-
if: startsWith(matrix.os, 'ubuntu')
90-
run: cross build --target x86_64-unknown-netbsd
91-
- name: FreeBSD
92-
if: startsWith(matrix.os, 'ubuntu')
93-
run: cross build --target x86_64-unknown-freebsd
9486
- name: iOS
9587
if: startsWith(matrix.os, 'macos')
96-
run: cross build --target aarch64-apple-ios
88+
run: |
89+
rustup target add aarch64-apple-ios
90+
cross build --target aarch64-apple-ios
9791
- name: Linux x32
9892
if: startsWith(matrix.os, 'ubuntu')
99-
run: cross check --target x86_64-unknown-linux-gnux32
93+
run: |
94+
rustup target add x86_64-unknown-linux-gnux32
95+
cross check --target x86_64-unknown-linux-gnux32
10096
- name: Fuchsia
10197
if: startsWith(matrix.os, 'ubuntu')
10298
run: |
103-
rustup target add x86_64-fuchsia
104-
cargo build --target x86_64-fuchsia
99+
rustup target add x86_64-unknown-fuchsia
100+
cargo build --target x86_64-unknown-fuchsia
105101
- name: illumos
106102
if: startsWith(matrix.os, 'ubuntu')
107103
run: |
108104
rustup target add x86_64-unknown-illumos
109105
cargo build --target x86_64-unknown-illumos
110106
107+
openbsd:
108+
runs-on: macos-12
109+
steps:
110+
- uses: actions/checkout@v3
111+
- name: Test OpenBSD
112+
id: test
113+
uses: vmactions/openbsd-vm@v0
114+
with:
115+
envs: CARGO_INCREMENTAL CARGO_NET_GIT_FETCH_WITH_CLI CARGO_NET_RETRY RUST_BACKTRACE RUSTFLAGS RUSTDOCFLAGS RUSTUP_MAX_RETRIES
116+
usesh: true
117+
# OpenBSD is tier 3 target, so install rust from package manager instead of rustup
118+
prepare: |
119+
pkg_add git rust
120+
run: |
121+
cargo test
122+
123+
dragonfly:
124+
runs-on: macos-12
125+
steps:
126+
- uses: actions/checkout@v3
127+
- name: Test Dragonfly BSD
128+
id: test
129+
uses: vmactions/dragonflybsd-vm@v0
130+
with:
131+
envs: CARGO_INCREMENTAL CARGO_NET_GIT_FETCH_WITH_CLI CARGO_NET_RETRY RUST_BACKTRACE RUSTFLAGS RUSTDOCFLAGS RUSTUP_MAX_RETRIES
132+
usesh: true
133+
# Dragonfly BSD is tier 3 target, so install rust from package manager instead of rustup
134+
prepare: |
135+
pkg install -y git rust
136+
run: |
137+
cargo test
138+
111139
msrv:
112140
runs-on: ${{ matrix.os }}
113141
strategy:

0 commit comments

Comments
 (0)