Skip to content

Commit

Permalink
ci: Fix cross builds in the CI (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
notgull authored Apr 9, 2023
1 parent 3a9b38b commit b73a368
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 14 deletions.
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

0 comments on commit b73a368

Please sign in to comment.