mirror of
https://github.com/jiangcuo/nix.git
synced 2025-08-26 16:58:56 +00:00

* chore: remove migrated CI tasks from Cirrus * chore: remove migrated CI tasks from Cirrus
84 lines
2.8 KiB
YAML
84 lines
2.8 KiB
YAML
cargo_cache:
|
|
folder: $CARGO_HOME/registry
|
|
fingerprint_script: cat Cargo.lock || echo ""
|
|
|
|
env:
|
|
# Build by default; don't just check
|
|
BUILD: build
|
|
CLIPPYFLAGS: -D warnings -A unknown-lints
|
|
RUSTFLAGS: -D warnings
|
|
RUSTDOCFLAGS: -D warnings
|
|
TOOL: cargo
|
|
MSRV: 1.69.0
|
|
ZFLAGS:
|
|
|
|
# Tests that don't require executing the build binaries
|
|
build: &BUILD
|
|
build_script:
|
|
- . $HOME/.cargo/env || true
|
|
- $TOOL -Vv
|
|
- rustc -Vv
|
|
- $TOOL $BUILD $ZFLAGS --target $TARGET --all-targets --all-features
|
|
- $TOOL doc $ZFLAGS --no-deps --target $TARGET --all-features
|
|
- $TOOL clippy $ZFLAGS --target $TARGET --all-targets --all-features -- $CLIPPYFLAGS
|
|
- if [ -z "$NOHACK" ]; then mkdir -p $HOME/.cargo/bin; export PATH=$HOME/.cargo/bin:$PATH; fi
|
|
- if [ -z "$NOHACK" ]; then curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-${HOST:-$TARGET}.tar.gz | tar xzf - -C ~/.cargo/bin; fi
|
|
- if [ -z "$NOHACK" ]; then $TOOL hack $ZFLAGS check --target $TARGET --each-feature; fi
|
|
|
|
# Tests that do require executing the binaries
|
|
test: &TEST
|
|
<< : *BUILD
|
|
test_script:
|
|
- . $HOME/.cargo/env || true
|
|
- $TOOL test --target $TARGET --all-features
|
|
|
|
# Test FreeBSD in a full VM. Test the i686 target too, in the
|
|
# same VM. The binary will be built in 32-bit mode, but will execute on a
|
|
# 64-bit kernel and in a 64-bit environment. Our tests don't execute any of
|
|
# the system's binaries, so the environment shouldn't matter.
|
|
task:
|
|
env:
|
|
TARGET: x86_64-unknown-freebsd
|
|
matrix:
|
|
- name: FreeBSD 14 amd64 & i686
|
|
freebsd_instance:
|
|
image_family: freebsd-14-0-snap
|
|
cpu: 1
|
|
# Enable tests that would fail on FreeBSD 12
|
|
RUSTFLAGS: --cfg fbsd14 -D warnings
|
|
RUSTDOCFLAGS: --cfg fbsd14
|
|
setup_script:
|
|
- kldload mqueuefs
|
|
- fetch https://sh.rustup.rs -o rustup.sh
|
|
- sh rustup.sh -y --profile=minimal --default-toolchain $MSRV
|
|
- . $HOME/.cargo/env
|
|
- rustup target add i686-unknown-freebsd
|
|
- rustup component add clippy
|
|
<< : *TEST
|
|
i386_test_script:
|
|
- . $HOME/.cargo/env
|
|
- cargo build --target i686-unknown-freebsd --all-features
|
|
- cargo doc --no-deps --target i686-unknown-freebsd --all-features
|
|
- cargo test --target i686-unknown-freebsd --all-features
|
|
i386_feature_script:
|
|
- . $HOME/.cargo/env
|
|
- if [ -z "$NOHACK" ]; then cargo hack check --each-feature --target i686-unknown-freebsd; fi
|
|
before_cache_script: rm -rf $CARGO_HOME/registry/index
|
|
|
|
# Tasks for Linux aarch64 native builds
|
|
task:
|
|
matrix:
|
|
- name: Linux aarch64
|
|
arm_container:
|
|
image: rust:1.69.0
|
|
cpu: 1
|
|
depends_on:
|
|
- FreeBSD 14 amd64 & i686
|
|
env:
|
|
TARGET: aarch64-unknown-linux-gnu
|
|
setup_script:
|
|
- rustup target add $TARGET
|
|
- rustup component add clippy
|
|
<< : *TEST
|
|
before_cache_script: rm -rf $CARGO_HOME/registry/index
|