2022-10-27 13:27:04 +03:00
|
|
|
%YAML 1.1
|
|
|
|
---
|
2022-10-29 12:37:45 +03:00
|
|
|
# Configuration for CirrusCI. This is primarily used for testing and building FreeBSD and macOS M1, since other
|
|
|
|
# CI platforms don't seem to support these platforms as of writing.
|
2022-10-28 05:00:37 +03:00
|
|
|
#
|
2023-04-11 11:57:29 +03:00
|
|
|
# Note that we set the YAML directive above to prevent some linting errors around the
|
2022-10-28 05:00:37 +03:00
|
|
|
# templates.
|
2022-10-20 08:27:14 +03:00
|
|
|
|
2022-10-21 17:47:55 +03:00
|
|
|
setup_template: &SETUP_TEMPLATE
|
2022-10-20 08:27:14 +03:00
|
|
|
setup_script:
|
2022-10-20 13:24:04 +03:00
|
|
|
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs --output rustup.sh
|
2022-10-20 08:27:14 +03:00
|
|
|
- sh rustup.sh --default-toolchain stable -y
|
2022-10-21 17:47:55 +03:00
|
|
|
|
|
|
|
cache_template: &CACHE_TEMPLATE
|
2022-10-20 08:27:14 +03:00
|
|
|
registry_cache:
|
2022-10-20 10:19:29 +03:00
|
|
|
folder: $HOME/.cargo/registry
|
|
|
|
reupload_on_changes: true
|
2022-10-21 17:47:55 +03:00
|
|
|
fingerprint_script:
|
|
|
|
- md5 Cargo.lock
|
|
|
|
- echo $CIRRUS_OS
|
|
|
|
- echo $CIRRUS_TASK_NAME
|
2022-10-20 08:27:14 +03:00
|
|
|
target_cache:
|
|
|
|
folder: target
|
2022-10-20 10:19:29 +03:00
|
|
|
reupload_on_changes: true
|
2022-10-20 08:27:14 +03:00
|
|
|
fingerprint_script:
|
|
|
|
- . $HOME/.cargo/env && rustc --version
|
2022-10-20 10:19:29 +03:00
|
|
|
- md5 Cargo.lock
|
2022-10-21 17:47:55 +03:00
|
|
|
- echo $CIRRUS_OS
|
|
|
|
- echo $CIRRUS_TASK_NAME
|
|
|
|
|
|
|
|
cleanup_template: &CLEANUP_TEMPLATE
|
2022-10-20 10:19:29 +03:00
|
|
|
before_cache_script:
|
|
|
|
- rm -rf $HOME/.cargo/registry/index
|
2022-10-26 11:58:51 +03:00
|
|
|
- rm -rf $HOME/.cargo/registry/src
|
2022-10-20 10:19:29 +03:00
|
|
|
- rm -f ./target/.rustc_info.json
|
2022-10-20 08:27:14 +03:00
|
|
|
|
2022-10-21 17:47:55 +03:00
|
|
|
env:
|
|
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
CARGO_PROFILE_DEV_DEBUG: 0
|
|
|
|
CARGO_HUSKY_DONT_INSTALL_HOOKS: true
|
|
|
|
|
|
|
|
test_task:
|
2023-12-06 08:16:26 +03:00
|
|
|
auto_cancellation: $CIRRUS_BRANCH != "main"
|
|
|
|
only_if: $CIRRUS_BUILD_SOURCE != "api" && ($CIRRUS_BRANCH == "main" || $CIRRUS_PR != "")
|
2022-10-29 12:37:45 +03:00
|
|
|
skip: "!changesInclude('.cargo/**', '.cirrus.yml', 'sample_configs/**', 'src/**', 'tests/**', 'build.rs', 'Cargo.lock', 'Cargo.toml', 'clippy.toml', 'rustfmt.toml')"
|
2022-10-21 17:47:55 +03:00
|
|
|
matrix:
|
|
|
|
- name: "FreeBSD 13 Test"
|
|
|
|
freebsd_instance:
|
|
|
|
image_family: freebsd-13-1
|
2022-12-03 04:12:49 +03:00
|
|
|
- name: "FreeBSD 12 Test"
|
|
|
|
freebsd_instance:
|
|
|
|
image_family: freebsd-12-3
|
2022-10-21 17:47:55 +03:00
|
|
|
- name: "macOS M1 Test"
|
|
|
|
macos_instance:
|
|
|
|
image: ghcr.io/cirruslabs/macos-monterey-base:latest
|
|
|
|
<<: *SETUP_TEMPLATE
|
|
|
|
<<: *CACHE_TEMPLATE
|
2022-10-20 13:41:20 +03:00
|
|
|
test_no_feature_script:
|
2022-10-20 10:19:29 +03:00
|
|
|
- . $HOME/.cargo/env
|
2022-10-20 08:27:14 +03:00
|
|
|
- cargo fmt --all -- --check
|
2022-10-20 13:41:20 +03:00
|
|
|
- cargo test --no-run --locked --no-default-features
|
2022-10-21 17:47:55 +03:00
|
|
|
- cargo test --no-fail-fast --no-default-features -- --nocapture --quiet
|
2022-10-20 13:41:20 +03:00
|
|
|
- cargo clippy --all-targets --workspace --no-default-features -- -D warnings
|
2023-03-07 08:18:42 +03:00
|
|
|
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
|
2022-10-21 17:47:55 +03:00
|
|
|
<<: *CLEANUP_TEMPLATE
|
|
|
|
|
|
|
|
build_task:
|
2022-10-27 13:27:04 +03:00
|
|
|
auto_cancellation: false
|
|
|
|
only_if: $CIRRUS_BUILD_SOURCE == "api"
|
2022-10-21 17:47:55 +03:00
|
|
|
env:
|
|
|
|
BTM_GENERATE: true
|
|
|
|
COMPLETION_DIR: "target/tmp/bottom/completion/"
|
|
|
|
MANPAGE_DIR: "target/tmp/bottom/manpage/"
|
2023-01-02 23:18:05 +03:00
|
|
|
# -PLACEHOLDER FOR CI-
|
2022-10-21 17:47:55 +03:00
|
|
|
matrix:
|
|
|
|
- name: "FreeBSD 13 Build"
|
2022-12-03 04:12:49 +03:00
|
|
|
alias: "freebsd_13_1_build"
|
2022-10-21 17:47:55 +03:00
|
|
|
freebsd_instance:
|
|
|
|
image_family: freebsd-13-1
|
|
|
|
env:
|
|
|
|
TARGET: "x86_64-unknown-freebsd"
|
2022-12-03 05:57:41 +03:00
|
|
|
NAME: "x86_64-unknown-freebsd-13-1"
|
2022-12-03 04:12:49 +03:00
|
|
|
- name: "FreeBSD 12 Build"
|
|
|
|
alias: "freebsd_12_3_build"
|
|
|
|
freebsd_instance:
|
|
|
|
image_family: freebsd-12-3
|
|
|
|
env:
|
|
|
|
TARGET: "x86_64-unknown-freebsd"
|
2022-12-03 05:57:41 +03:00
|
|
|
NAME: "x86_64-unknown-freebsd-12-3"
|
2022-10-21 17:47:55 +03:00
|
|
|
- name: "macOS M1 Build"
|
2022-10-26 11:58:51 +03:00
|
|
|
alias: "macos_build"
|
2022-10-21 17:47:55 +03:00
|
|
|
macos_instance:
|
|
|
|
image: ghcr.io/cirruslabs/macos-monterey-base:latest
|
|
|
|
env:
|
|
|
|
TARGET: "aarch64-apple-darwin"
|
2022-12-03 05:57:41 +03:00
|
|
|
NAME: "aarch64-apple-darwin"
|
2022-10-21 17:47:55 +03:00
|
|
|
<<: *SETUP_TEMPLATE
|
|
|
|
<<: *CACHE_TEMPLATE
|
|
|
|
build_script:
|
|
|
|
- . $HOME/.cargo/env
|
|
|
|
- cargo build --release --verbose --locked --features deploy
|
|
|
|
- mv ./target/release/btm ./
|
2023-01-02 23:18:05 +03:00
|
|
|
- ./btm -V
|
2022-10-21 17:47:55 +03:00
|
|
|
- mv "$COMPLETION_DIR" completion
|
|
|
|
- mv "$MANPAGE_DIR" manpage
|
2022-12-03 05:57:41 +03:00
|
|
|
- tar -czvf bottom_$NAME.tar.gz btm completion
|
2022-10-21 17:47:55 +03:00
|
|
|
binaries_artifacts:
|
2022-12-03 05:57:41 +03:00
|
|
|
path: bottom_$NAME.tar.gz
|
2022-10-21 17:47:55 +03:00
|
|
|
<<: *CLEANUP_TEMPLATE
|