76 lines
2.7 KiB
YAML
76 lines
2.7 KiB
YAML
pre_plan:
|
||
- action: cargo_fetch
|
||
# Define the compatible toolchain channel used by `heartwood`.
|
||
# This channel is also defined in `rust-toolchain.toml` – which hopefully can
|
||
# be supported by ambient in the future.
|
||
- action: rustup
|
||
channel: 1.95.0
|
||
- action: rustup
|
||
channel: "1.95"
|
||
plan:
|
||
# Remove the components from rust-toolchain.toml. This works around the
|
||
# inability of the rustup action to install components, and the only component
|
||
# in the heartwood toolchain file is rust-src, which we do not need for CI,
|
||
# so we just remove it.
|
||
- action: shell
|
||
shell: |
|
||
sed -i /components/d rust-toolchain.toml
|
||
|
||
# Commit this to git so that the Debian package building doesn't
|
||
# see changes outside the debian directory.
|
||
git config set user.name "Ambient CI"
|
||
git config set user.email "ambient@example.com"
|
||
git commit -m "remove components from toolchain file" rust-toolchain.toml
|
||
|
||
- action: cargo_fmt
|
||
- action: cargo_clippy
|
||
- action: cargo_build
|
||
- action: cargo_test
|
||
|
||
# Make sure docs build.
|
||
- action: shell
|
||
shell: |
|
||
# Because of a (temporary) limitation in Ambient, we need to set
|
||
# these variables manually. Once Ambient manages environment
|
||
# variables better, these can be deleted.
|
||
export CARGO_TARGET_DIR=/workspace/cache
|
||
export CARGO_HOME=/workspace/deps
|
||
export HOME=/root
|
||
export PATH="/root/.cargo/bin:$PATH"
|
||
export RUSTDOCFLAGS='-D warnings'
|
||
|
||
cargo doc --workspace --no-deps --all-features
|
||
|
||
# Prepare source tree for building a Debian package.
|
||
- action: shell
|
||
shell: |
|
||
# Because of a (temporary) limitation in Ambient, we need to set
|
||
# these variables manually. Once Ambient manages environment
|
||
# variables better, these can be deleted.
|
||
export CARGO_TARGET_DIR=/workspace/cache
|
||
export CARGO_HOME=/workspace/deps
|
||
export HOME=/root
|
||
export PATH="/root/.cargo/bin:$PATH"
|
||
|
||
# These are based on debian/control.
|
||
export DEBEMAIL=liw@liw.fi
|
||
export DEBFULLNAME="Lars Wirzenius"
|
||
|
||
# Clean up after tests and documentation building. The Debian
|
||
# package building tools do not want changes outside the
|
||
# `debian` directory, compared to what is committed to Git, from
|
||
# which the "upstream tarball" is created.
|
||
git reset --hard
|
||
git clean -fdx
|
||
git status --ignored
|
||
|
||
# Update debian/changelog with a new version so that every run
|
||
# creates a newer version. This avoids us having to update the
|
||
# file manually for every CI run.
|
||
V="$(dpkg-parsechangelog -SVersion | sed 's/-[^-]*$//')"
|
||
T="$(date -u "+%Y%m%dT%H%M%S")"
|
||
version="$V.ci$T-1"
|
||
dch -v "$version" "CI build under Ambient."
|
||
dch -r ''
|
||
- action: deb
|