mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-23 21:55:11 +02:00
ci: various Cirrus CI test fixes (#844)
Some cache and conditional fixes for Cirrus CI testing. The test tasks should only run on the default branch and on PRs.
This commit is contained in:
parent
530f6bf3b3
commit
8043a72029
61
.cirrus.yml
61
.cirrus.yml
@ -1,5 +1,5 @@
|
|||||||
# Configuration for CirrusCI. This is primarily used for
|
# Configuration for CirrusCI. This is primarily used for
|
||||||
# FreeBSD and macOS M1 testing and building.
|
# FreeBSD and macOS M1 tests and builds.
|
||||||
|
|
||||||
env:
|
env:
|
||||||
CARGO_INCREMENTAL: 0
|
CARGO_INCREMENTAL: 0
|
||||||
@ -7,52 +7,75 @@ env:
|
|||||||
CARGO_HUSKY_DONT_INSTALL_HOOKS: true
|
CARGO_HUSKY_DONT_INSTALL_HOOKS: true
|
||||||
|
|
||||||
task:
|
task:
|
||||||
name: FreeBSD 13 Test
|
name: "FreeBSD 13 Test"
|
||||||
|
only_if: $CIRRUS_BRANCH == "master" || $CIRRUS_PR != ""
|
||||||
freebsd_instance:
|
freebsd_instance:
|
||||||
image_family: freebsd-13-1
|
image_family: freebsd-13-1
|
||||||
|
matrix:
|
||||||
|
- env:
|
||||||
|
FEATURES: "--all-features"
|
||||||
|
- env:
|
||||||
|
FEATURES: "--no-default-features"
|
||||||
setup_script:
|
setup_script:
|
||||||
- pkg install -y curl
|
|
||||||
- curl https://sh.rustup.rs -sSf --output rustup.sh
|
- curl https://sh.rustup.rs -sSf --output rustup.sh
|
||||||
- sh rustup.sh --default-toolchain stable -y
|
- sh rustup.sh --default-toolchain stable -y
|
||||||
- . $HOME/.cargo/env
|
- . $HOME/.cargo/env
|
||||||
- rustc --version
|
- rustc --version
|
||||||
registry_cache:
|
registry_cache:
|
||||||
folder: $CARGO_HOME/registry
|
folder: $HOME/.cargo/registry
|
||||||
fingerprint_script: cat Cargo.lock
|
reupload_on_changes: true
|
||||||
|
fingerprint_script: md5 Cargo.lock
|
||||||
target_cache:
|
target_cache:
|
||||||
folder: target
|
folder: target
|
||||||
|
reupload_on_changes: true
|
||||||
fingerprint_script:
|
fingerprint_script:
|
||||||
- . $HOME/.cargo/env && rustc --version
|
- . $HOME/.cargo/env && rustc --version
|
||||||
- cat Cargo.lock
|
- md5 Cargo.lock
|
||||||
|
- echo $FEATURES
|
||||||
test_script:
|
test_script:
|
||||||
- . $HOME/.cargo/env
|
- . $HOME/.cargo/env
|
||||||
- cargo fmt --all -- --check
|
- cargo fmt --all -- --check
|
||||||
- cargo test --no-run --locked
|
- cargo test --no-run --locked $FEATURES
|
||||||
- cargo test --no-fail-fast -- --nocapture --quiet
|
- cargo test --no-fail-fast $FEATURES -- --nocapture --quiet
|
||||||
- cargo clippy --all-targets --workspace -- -D warnings
|
- cargo clippy --all-targets --workspace $FEATURES -- -D warnings
|
||||||
before_cache_script: rm -rf $CARGO_HOME/registry/index
|
before_cache_script:
|
||||||
|
- rm -rf $HOME/.cargo/registry/index
|
||||||
|
- rm -f ./target/.rustc_info.json
|
||||||
|
- find ./target/debug -maxdepth 1 -type f -delete # Delete stray files
|
||||||
|
|
||||||
task:
|
task:
|
||||||
name: macOS M1 Test
|
name: "macOS M1 Test"
|
||||||
|
only_if: $CIRRUS_BRANCH == "master" || $CIRRUS_PR != ""
|
||||||
macos_instance:
|
macos_instance:
|
||||||
image: ghcr.io/cirruslabs/macos-monterey-base:latest
|
image: ghcr.io/cirruslabs/macos-monterey-base:latest
|
||||||
|
matrix:
|
||||||
|
- env:
|
||||||
|
FEATURES: "--all-features"
|
||||||
|
- env:
|
||||||
|
FEATURES: "--no-default-features"
|
||||||
setup_script:
|
setup_script:
|
||||||
- curl https://sh.rustup.rs -sSf --output rustup.sh
|
- curl https://sh.rustup.rs -sSf --output rustup.sh
|
||||||
- sh rustup.sh --default-toolchain stable -y
|
- sh rustup.sh --default-toolchain stable -y
|
||||||
- source $HOME/.cargo/env
|
- source $HOME/.cargo/env
|
||||||
- rustc --version
|
- rustc --version
|
||||||
registry_cache:
|
registry_cache:
|
||||||
folder: $CARGO_HOME/registry
|
folder: $HOME/.cargo/registry
|
||||||
fingerprint_script: cat Cargo.lock
|
reupload_on_changes: true
|
||||||
|
fingerprint_script: md5 Cargo.lock
|
||||||
target_cache:
|
target_cache:
|
||||||
folder: target
|
folder: target
|
||||||
|
reupload_on_changes: true
|
||||||
fingerprint_script:
|
fingerprint_script:
|
||||||
- source $HOME/.cargo/env && rustc --version
|
- source $HOME/.cargo/env && rustc --version
|
||||||
- cat Cargo.lock
|
- md5 Cargo.lock
|
||||||
|
- echo $FEATURES
|
||||||
test_script:
|
test_script:
|
||||||
- source $HOME/.cargo/env
|
- . $HOME/.cargo/env
|
||||||
- cargo fmt --all -- --check
|
- cargo fmt --all -- --check
|
||||||
- cargo test --no-run --locked
|
- cargo test --no-run --locked $FEATURES
|
||||||
- cargo test --no-fail-fast -- --nocapture --quiet
|
- cargo test --no-fail-fast $FEATURES -- --nocapture --quiet
|
||||||
- cargo clippy --all-targets --workspace -- -D warnings
|
- cargo clippy --all-targets --workspace $FEATURES -- -D warnings
|
||||||
before_cache_script: rm -rf $CARGO_HOME/registry/index
|
before_cache_script:
|
||||||
|
- rm -rf $HOME/.cargo/registry/index
|
||||||
|
- rm -f ./target/.rustc_info.json
|
||||||
|
- find ./target/debug -maxdepth 1 -type f -delete # Delete stray files
|
||||||
|
Loading…
x
Reference in New Issue
Block a user