From c4b79d03852dc4668473a078057bf2f63feae7b6 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 14 Feb 2024 13:41:57 +0200 Subject: ambient.yaml: add ambient-driver project Signed-off-by: Lars Wirzenius Sponsored-by: author --- ambient.yaml | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/ambient.yaml b/ambient.yaml index 74fa04a..42655f7 100644 --- a/ambient.yaml +++ b/ambient.yaml @@ -13,6 +13,81 @@ projects: post_plan: - action: rsync + ambient-driver: + image: ~/tmp/ambient/ambient-boot.qcow2 + source: ~/pers/ambient-ci/ambient-driver + pre_plan: + - action: cargo_fetch + plan: +# - action: rustup_setup +# - action: cargo_fmt +# - action: cargo_clippy +# - action: cargo_build +# - action: cargo_test + - action: shell + shell: | + + # FIXME: Put this in the Ambient `deb` action. + + export PATH="/root/.cargo/bin:$PATH" + export CARGO_HOME=/workspace/deps + mkdir /workspace/cargo + export CARGO_TARGET_DIR=/workspace/cargo + export DEBEMAIL=liw@liw.fi + export DEBFULLNAME="Lars Wirzenius" + env + + command -v cargo + command -v rustc + + cargo --version + rustc --version + + cargo check --offline + + git status --ignored + git clean -fdx + + 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 '' + + # Get name and version of source package. + name="$(dpkg-parsechangelog -SSource)" + version="$(dpkg-parsechangelog -SVersion)" + + # Get upstream version: everything before the last dash. + uv="$(echo "$version" | sed 's/-[^-]*$//')" + orig="${name}_${uv}.orig.tar.xz" + + # Create a tar ball without the Debian packaging. + tmp="$(mktemp -d)" + trap 'rm -rf "$tmp"' EXIT + git archive HEAD | tar -C "$tmp" -xf - + rm -rf "$tmp/debian" + tar -C "$tmp" -cf - . | xz >"../$orig" + + # Actually build the package, without signing the .changes file. + dpkg-buildpackage -us -uc + + # Dump some information to make it easier to visually verify + # everything looks OK. Also, test the package with the lintian tool. + arch="$(dpkg --print-architecture)" + deb="../${name}_${version}_${arch}.deb" + changes="../${name}_${version}_${arch}.changes" + + ls -l "$deb" + dpkg -c "$deb" + lintian -i "$changes" + + mv ../*_* /workspace/artifacts + +# - action: deb + post_plan: + - action: dput + ambient-web: image: ~/tmp/ambient/ambient-boot.qcow2 source: ~/pers/ambient-ci/ambient-web/src/ -- cgit v1.2.1