bottom/.cirrus.yml

117 lines
3.8 KiB
YAML
Raw Normal View History

%YAML 1.1
---
# Configuration for CirrusCI. This is primarily used for testing and building FreeBSD and old versions of Linux,
# since other CI platforms don't support build jobs for these configurations.
#
# Note that we set the YAML directive above to prevent some linting errors around the templates.
setup_template: &SETUP_TEMPLATE
setup_script:
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs --output rustup.sh
- sh rustup.sh --default-toolchain stable -y
cache_template: &CACHE_TEMPLATE
registry_cache:
folder: $HOME/.cargo/registry
reupload_on_changes: "true"
fingerprint_script:
- $HOME/.cargo/bin/rustc --version
- cat Cargo.lock
- echo $CIRRUS_OS
- echo $CIRRUS_TASK_NAME
target_cache:
folder: target
reupload_on_changes: "true"
fingerprint_script:
- $HOME/.cargo/bin/rustc --version
- cat Cargo.lock
- echo $CIRRUS_OS
- echo $CIRRUS_TASK_NAME
cleanup_template: &CLEANUP_TEMPLATE
before_cache_script:
- rm -rf $HOME/.cargo/registry/index
- rm -rf $HOME/.cargo/registry/src
- rm -f ./target/.rustc_info.json
env:
CARGO_INCREMENTAL: "0"
CARGO_PROFILE_DEV_DEBUG: "0"
CARGO_HUSKY_DONT_INSTALL_HOOKS: "true"
test_task:
auto_cancellation: "false" # We set this to false to prevent nightly builds from affecting this
only_if: $CIRRUS_BUILD_SOURCE != "api" && ($CIRRUS_BRANCH == "main" || $CIRRUS_PR != "")
timeout_in: "15m"
skip: "!changesInclude('.cargo/**', 'sample_configs/**', 'scripts/cirrus/**', 'src/**', 'tests/**', '.cirrus.yml', 'build.rs', 'Cargo.lock', 'Cargo.toml', 'clippy.toml', 'rustfmt.toml')"
matrix:
- name: "FreeBSD 14 Test"
freebsd_instance:
image_family: freebsd-14-0
- name: "FreeBSD 13 Test"
freebsd_instance:
image_family: freebsd-13-3
<<: *SETUP_TEMPLATE
<<: *CACHE_TEMPLATE
test_no_feature_script:
- . $HOME/.cargo/env
- cargo fmt --all -- --check
- cargo test --no-run --locked --no-default-features
- cargo test --no-fail-fast --no-default-features -- --nocapture --quiet
- cargo clippy --all-targets --workspace --no-default-features -- -D warnings
test_all_feature_script:
- . $HOME/.cargo/env
- cargo fmt --all -- --check
- cargo test --no-run --locked --all-features
- cargo test --no-fail-fast --all-features -- --nocapture --quiet
- cargo clippy --all-targets --workspace --all-features -- -D warnings
<<: *CLEANUP_TEMPLATE
release_task:
auto_cancellation: "false"
only_if: $CIRRUS_BUILD_SOURCE == "api" && $BTM_BUILD_RELEASE_CALLER == "ci"
timeout_in: "30m"
env:
BTM_GENERATE: "true"
COMPLETION_DIR: "target/tmp/bottom/completion/"
MANPAGE_DIR: "target/tmp/bottom/manpage/"
# -PLACEHOLDER FOR CI-
matrix:
- name: "FreeBSD 14 Build"
alias: "freebsd_14_0_build"
freebsd_instance:
image_family: freebsd-14-0
env:
TARGET: "x86_64-unknown-freebsd"
NAME: "x86_64-unknown-freebsd-14-0"
- name: "FreeBSD 13 Build"
alias: "freebsd_13_3_build"
freebsd_instance:
image_family: freebsd-13-3
env:
TARGET: "x86_64-unknown-freebsd"
NAME: "x86_64-unknown-freebsd-13-3"
- name: "Legacy Linux (2.17)"
alias: "linux_2_17_build"
container:
image: quay.io/pypa/manylinux2014_x86_64
env:
TARGET: "x86_64-unknown-linux-gnu"
NAME: "x86_64-unknown-linux-gnu-2-17"
<<: *SETUP_TEMPLATE
<<: *CACHE_TEMPLATE
build_script:
- . $HOME/.cargo/env
- cargo build --release --verbose --locked --features deploy
- mv ./target/release/btm ./
- ./btm -V
- mv "$COMPLETION_DIR" completion
- mv "$MANPAGE_DIR" manpage
- tar -czvf bottom_$NAME.tar.gz btm completion
binaries_artifacts:
path: bottom_$NAME.tar.gz
<<: *CLEANUP_TEMPLATE