Skip to content

ci: Fix cross builds in the CI #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
only_if: $CIRRUS_TAG == '' && ($CIRRUS_PR != '' || $CIRRUS_BRANCH == 'master')
auto_cancellation: $CIRRUS_BRANCH != 'master'
env:
CARGO_INCREMENTAL: '0'
CARGO_NET_GIT_FETCH_WITH_CLI: 'true'
CARGO_NET_RETRY: '10'
CARGO_TERM_COLOR: always
RUST_BACKTRACE: '1'
RUSTDOCFLAGS: -D warnings
RUSTFLAGS: -D warnings
RUSTUP_MAX_RETRIES: '10'

freebsd_task:
name: test ($TARGET)
freebsd_instance:
image_family: freebsd-12-4
matrix:
- env:
TARGET: x86_64-unknown-freebsd
- env:
TARGET: i686-unknown-freebsd
setup_script:
# https://github.com/cirruslabs/cirrus-ci-docs/issues/483
- sudo sysctl net.inet.tcp.blackhole=0
- pkg install -y git
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable --target $TARGET
test_script:
- . $HOME/.cargo/env
- cargo test --target $TARGET
56 changes: 42 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,36 +78,64 @@ jobs:
- name: Install Rust
run: rustup update stable
- name: Install cross
uses: taiki-e/install-action@v2
with:
# https://github.com/cross-rs/cross/issues/724
tool: [email protected]
uses: taiki-e/install-action@cross
# We don't test BSDs, since we already test them in Cirrus/vmactions.
- name: Android
if: startsWith(matrix.os, 'ubuntu')
run: cross test --target arm-linux-androideabi
- name: NetBSD
if: startsWith(matrix.os, 'ubuntu')
run: cross build --target x86_64-unknown-netbsd
- name: FreeBSD
if: startsWith(matrix.os, 'ubuntu')
run: cross build --target x86_64-unknown-freebsd
- name: iOS
if: startsWith(matrix.os, 'macos')
run: cross build --target aarch64-apple-ios
run: |
rustup target add aarch64-apple-ios
cross build --target aarch64-apple-ios
- name: Linux x32
if: startsWith(matrix.os, 'ubuntu')
run: cross check --target x86_64-unknown-linux-gnux32
run: |
rustup target add x86_64-unknown-linux-gnux32
cross check --target x86_64-unknown-linux-gnux32
- name: Fuchsia
if: startsWith(matrix.os, 'ubuntu')
run: |
rustup target add x86_64-fuchsia
cargo build --target x86_64-fuchsia
rustup target add x86_64-unknown-fuchsia
cargo build --target x86_64-unknown-fuchsia
- name: illumos
if: startsWith(matrix.os, 'ubuntu')
run: |
rustup target add x86_64-unknown-illumos
cargo build --target x86_64-unknown-illumos

openbsd:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Test OpenBSD
id: test
uses: vmactions/openbsd-vm@v0
with:
envs: CARGO_INCREMENTAL CARGO_NET_GIT_FETCH_WITH_CLI CARGO_NET_RETRY RUST_BACKTRACE RUSTFLAGS RUSTDOCFLAGS RUSTUP_MAX_RETRIES
usesh: true
# OpenBSD is tier 3 target, so install rust from package manager instead of rustup
prepare: |
pkg_add git rust
run: |
cargo test

dragonfly:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Test Dragonfly BSD
id: test
uses: vmactions/dragonflybsd-vm@v0
with:
envs: CARGO_INCREMENTAL CARGO_NET_GIT_FETCH_WITH_CLI CARGO_NET_RETRY RUST_BACKTRACE RUSTFLAGS RUSTDOCFLAGS RUSTUP_MAX_RETRIES
usesh: true
# Dragonfly BSD is tier 3 target, so install rust from package manager instead of rustup
prepare: |
pkg install -y git rust
run: |
cargo test

msrv:
runs-on: ${{ matrix.os }}
strategy:
Expand Down