cargo-semver-checks with a pinned 1.0.0 baseline in scripts/ci.sh (skipped where the tool is absent); the GitHub Actions ci job installs a prebuilt binary so the gate is enforced there.
83 lines
2.8 KiB
YAML
83 lines
2.8 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
ci:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
|
|
# Keep in sync with rust-toolchain.toml.
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
|
|
with:
|
|
toolchain: 1.99.0
|
|
components: rustfmt, clippy
|
|
targets: thumbv7em-none-eabihf
|
|
|
|
- name: Cache cargo registry and target
|
|
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
|
|
|
|
# System library for tines-bt's bluer crate (D-Bus dev headers); the
|
|
# workspace build links libdbus-sys against system dbus-1. Keep in sync
|
|
# with Dockerfile.ros2.
|
|
- name: Install system dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y --no-install-recommends libdbus-1-dev pkg-config
|
|
|
|
# The semver gate in scripts/ci.sh compares tines-core against the
|
|
# published 1.0.0; a prebuilt binary keeps this fast (a from-source
|
|
# install would dominate the job).
|
|
- name: Install cargo-semver-checks
|
|
run: |
|
|
curl -LsSf https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz | tar xzf - -C "$HOME/.cargo/bin"
|
|
cargo binstall --no-confirm cargo-semver-checks
|
|
|
|
- name: Run CI gate
|
|
run: sh scripts/ci.sh
|
|
|
|
msrv:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 20
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
|
|
|
|
# Keep in sync with tines-core/Cargo.toml `rust-version`.
|
|
- name: Install Rust toolchain
|
|
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
|
|
with:
|
|
toolchain: 1.82.0
|
|
targets: thumbv7em-none-eabihf
|
|
|
|
- name: Cache cargo registry and target
|
|
uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
|
|
|
|
# Build only: the MSRV promise covers building tines-core, not its
|
|
# dev-dependencies. proptest pulls in crates that need edition 2024,
|
|
# which 1.82 can't parse, so `cargo test` can't run here. The tests run
|
|
# on the pinned toolchain in the `ci` job. `+1.82.0` overrides
|
|
# rust-toolchain.toml.
|
|
- name: Build tines-core on MSRV
|
|
run: |
|
|
cargo +1.82.0 build --locked -p tines-core
|
|
cargo +1.82.0 build --locked -p tines-core --no-default-features
|
|
cargo +1.82.0 build --locked -p tines-core --no-default-features --target thumbv7em-none-eabihf
|