From 530f6bf3b322343a107297e3b2fff9a9d4004b95 Mon Sep 17 00:00:00 2001 From: Clement Tsang <34804052+ClementTsang@users.noreply.github.com> Date: Thu, 20 Oct 2022 01:27:14 -0400 Subject: [PATCH] ci: add basic Cirrus CI testing for FreeBSD + M1 (#827) * ci: add basic Cirrus CI testing for FreeBSD + M1 * add env vars * remove curl installation from macos script * add caching --- .cirrus.yml | 58 ++++++++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 7 +---- 2 files changed, 59 insertions(+), 6 deletions(-) create mode 100644 .cirrus.yml diff --git a/.cirrus.yml b/.cirrus.yml new file mode 100644 index 00000000..fde8dee3 --- /dev/null +++ b/.cirrus.yml @@ -0,0 +1,58 @@ +# Configuration for CirrusCI. This is primarily used for +# FreeBSD and macOS M1 testing and building. + +env: + CARGO_INCREMENTAL: 0 + CARGO_PROFILE_DEV_DEBUG: 0 + CARGO_HUSKY_DONT_INSTALL_HOOKS: true + +task: + name: FreeBSD 13 Test + freebsd_instance: + image_family: freebsd-13-1 + setup_script: + - pkg install -y curl + - curl https://sh.rustup.rs -sSf --output rustup.sh + - sh rustup.sh --default-toolchain stable -y + - . $HOME/.cargo/env + - rustc --version + registry_cache: + folder: $CARGO_HOME/registry + fingerprint_script: cat Cargo.lock + target_cache: + folder: target + fingerprint_script: + - . $HOME/.cargo/env && rustc --version + - cat Cargo.lock + test_script: + - . $HOME/.cargo/env + - cargo fmt --all -- --check + - cargo test --no-run --locked + - cargo test --no-fail-fast -- --nocapture --quiet + - cargo clippy --all-targets --workspace -- -D warnings + before_cache_script: rm -rf $CARGO_HOME/registry/index + +task: + name: macOS M1 Test + macos_instance: + image: ghcr.io/cirruslabs/macos-monterey-base:latest + setup_script: + - curl https://sh.rustup.rs -sSf --output rustup.sh + - sh rustup.sh --default-toolchain stable -y + - source $HOME/.cargo/env + - rustc --version + registry_cache: + folder: $CARGO_HOME/registry + fingerprint_script: cat Cargo.lock + target_cache: + folder: target + fingerprint_script: + - source $HOME/.cargo/env && rustc --version + - cat Cargo.lock + test_script: + - source $HOME/.cargo/env + - cargo fmt --all -- --check + - cargo test --no-run --locked + - cargo test --no-fail-fast -- --nocapture --quiet + - cargo clippy --all-targets --workspace -- -D warnings + before_cache_script: rm -rf $CARGO_HOME/registry/index diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44cc2824..eb24e061 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,12 +48,7 @@ jobs: target: "x86_64-pc-windows-msvc", cross: false, } - features: [ - "--all-features", - # "--features battery", - # "--features gpu", - "--no-default-features", - ] + features: ["--all-features", "--no-default-features"] steps: - name: Check if this action should be skipped id: skip_check