From abdb87dd23b6b120471edd7927fb6a7fc912b16b Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Wed, 28 Jun 2023 14:51:22 +0200 Subject: [PATCH] CI: Add .gitlab-ci.yml --- .gitlab-ci.yml | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 000000000..fb1dd1b93 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,86 @@ +stages: + - approve + - test + +approve1: + stage: approve + script: + - echo "Approved..." + rules: + # TODO: Filter only safe repositories, or user in developers + - if: $CI_PROJECT_PATH != "csonto/lvm2" && $CI_PROJECT_PATH != "lvmteam/lvm2" + when: manual + # TODO: for other branches than main/rhel: run pipeline only when requested: + - if: $CI_COMMIT_BRANCH != "main" && $CI_COMMIT_BRANCH !~ "^rhel.*" + when: manual + - when: on_success + allow_failure: false + +# TODO: +# - check results of autoreconf and make generate - may need additional commit +# - we need a particular setup (rawhide OR latest supported fedora?) +# - do make rpm and publish results as artifacts - we will use packit/COPR for this eventually + +# Run on any commits to main (master), rhel8, rhel9 branches +test-job: + stage: test + parallel: + matrix: + - TAG: rhel8 + CONFIGURE: > + --with-cluster=internal + --enable-cmirrord + - TAG: rhel9 + CONFIGURE: > + --with-default-use-devices-file=1 + --enable-app-machineid + --enable-editline + --disable-readline + artifacts: + paths: + - test/results/ + expire_in: 1 week + tags: + - ${TAG} + script: + # Common options go here, diffs to the above matrix + - > + ./configure ${CONFIGURE} + --enable-fsadm + --enable-write_install + --enable-pkgconfig + --enable-cmdlib + --enable-dmeventd + --enable-blkid_wiping + --enable-udev_sync + --with-thin=internal + --with-cache=internal + --enable-lvmpolld + --enable-lvmlockd-dlm --enable-lvmlockd-dlmcontrol + --enable-lvmlockd-sanlock + --enable-dbus-service --enable-notify-dbus + --enable-dmfilemapd + --with-writecache=internal + --with-vdo=internal --with-vdo-format=/usr/bin/vdoformat + --with-integrity=internal + --disable-silent-rules + - make + - rm -rf test/results + - mkdir -p /dev/shm/lvm2-test + - mount -o remount,dev /dev/shm + # TODO: Need to distinguish failed test from failed harness + # TODO: Also need a way to find if run is incomplete, e.g. full disk resulting in many skipped tests + - VERBOSE=0 BATCH=1 LVM_TEST_DIR=/dev/shm/lvm2-test make check || true + - rm -rf /dev/shm/lvm2-test + - cut -d' ' -f2 test/results/list | sort | uniq -c + # Filter artifacts - keep only logs from tests which are not pass + - cd test/results && rm $(grep 'passed$' list | cut -d' ' -f1 | sed -e 's|/|_|g' -e 's|.*|\0.txt|') + # TODO: Keep a list of known failures, and translate into regexp - or simply use python... + - if grep failed test/results/list | grep -v '\\\(dbustest\|lvconvert-mirror\)\.sh' | sort; then false; else true; fi + rules: + # Filter only safe repositories, or user in developers: + # NOTE: Already done in approve stage, may be more caution than necessary + - if: $CI_PROJECT_PATH != "csonto/lvm2" && $CI_PROJECT_PATH != "lvmteam/lvm2" + when: manual + - when: on_success +