chiark / gitweb /
Add a gitlab CI file
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 14 Jun 2023 23:00:49 +0000 (00:00 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 15 Jun 2023 01:12:46 +0000 (02:12 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
.gitlab-ci.yml [new file with mode: 0644]

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644 (file)
index 0000000..60f4cda
--- /dev/null
@@ -0,0 +1,90 @@
+
+stages:
+  - early
+  - check
+  - test
+
+variables:
+  BUILD_VERBOSE: "true"
+  MAKE_CHECK_PACKAGES: "util-linux iproute2 userv-utils net-tools iputils-ping"
+
+image: "debian:bookworm-slim"
+
+default:
+  before_script:
+    - rustc --version ||true
+    - cargo --version ||true
+
+image: "debian:bookworm-slim"
+
+cargo-check:
+  stage: check
+  image: "rust:latest"
+  script:
+    - cargo check --locked --workspace --verbose --all-features
+
+cargo-test:
+  stage: test
+  image: "rust:latest"
+  script:
+    - cargo test --locked --workspace --verbose --all-features
+
+cargo-update-test-nightly:
+  stage: test
+  image: "rustlang/rust:nightly"
+  allow_failure: true
+  script:
+    - cargo update
+    - cargo test --locked --workspace --verbose --all-features
+
+build-docs:
+  stage: check
+  script:
+    - apt-get -y update
+    - apt-get -y -Pupstream-cargo build-dep .
+    - make doc
+
+test-rust-upstream:
+  stage: test
+  image: "rust:bookworm"
+  script:
+    - apt-get -y update
+    - apt-get -y -Pupstream-cargo build-dep .
+    - apt-get -y install $MAKE_CHECK_PACKAGES
+    - dpkg-buildpackage -Pupstream-cargo -uc -b
+
+# This test is marked allow-fail because Debian development breaks
+# things on a regular basis.
+test-debian-bookworm:
+  stage: test
+  image: "debian:bookworm-slim"
+  allow_failure: true
+  script:
+    - apt-get -y update
+    - apt-get -y build-dep .
+    - apt-get -y install $MAKE_CHECK_PACKAGES
+    - dpkg-buildpackage -uc -b
+
+# This test is marked allow-fail because Debian development breaks
+# things on a regular basis.
+test-debian-unstable:
+  stage: test
+  image: "debian:unstable-slim"
+  allow_failure: true
+  script:
+    - apt-get -y update
+    - apt-get -y build-dep .
+    - apt-get -y install $MAKE_CHECK_PACKAGES
+    - dpkg-buildpackage -uc -b
+
+# Ideally we'd run autopkgtest here.
+# However, our autopkgtests use overlayfs which doesn't seem available.
+# The adt-initscript test seemed to work but probably isn't worth the candle.
+#autopkgtest:
+#  stage: comprehensive
+#  script:
+#    - apt-get -y update
+#    - apt-get -y -Pupstream-cargo build-dep .
+#    - apt-get -y install autopkgtest
+#    - DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -Pupstream-cargo -uc -us --build=full
+#    - autopkgtest --ignore-restrictions=x-hippotat-adt-broken-in-debci ../hippotat_*.changes --- null