aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@yeah.nah.nz>2020-09-05 15:56:26 +1200
committerDavid Phillips <david@yeah.nah.nz>2020-09-05 16:18:49 +1200
commit5dd638fecd5c31b019c62ebb817bdef11a8a49b2 (patch)
tree8527aee040954bff4f2e5328a6fd18fa9d42eddf
parent76f2d2c7429a4b85aceafa0080df0af3cd1ad2b5 (diff)
downloadsand-leek-5dd638fecd5c31b019c62ebb817bdef11a8a49b2.tar.xz
Update GitLab pipeline
Misc restructuring to increase reuse between jobs. Also fixes missing python issue on recent Ubuntu containers
-rw-r--r--.gitlab-ci.yml85
-rwxr-xr-xtest/run-shellcheck.sh13
2 files changed, 53 insertions, 45 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index ca78a96..7ea6f33 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,51 +1,46 @@
stages:
- - build-test-all
+ - Build
+ - Test
-arch:
- image: archlinux/base
- stage: build-test-all
- before_script:
- - pacman --noconfirm --needed -Syu base-devel clang python
- script:
- - make CC=gcc clean all test
- - make CC=clang clean all test
+.build-generic:
+ stage: Build
+ script:
+ - make CC=gcc clean all test
+ - make CC=clang clean all test
+ artifacts:
+ paths:
+ - sand-leek
+ expire_in: 1 year
-debian-stable:
- image: debian:stable
- stage: build-test-all
- before_script:
- - apt-get update
- - apt-get -y install build-essential clang libssl-dev openssl
- script:
- - make CC=gcc clean all test
- - make CC=clang clean all test
+.build-debian-derived:
+ extends: .build-generic
+ before_script:
+ - apt-get update
+ - apt-get -y install build-essential clang libssl-dev openssl python
-ubuntu-trusty:
- image: ubuntu:trusty
- stage: build-test-all
- before_script:
- - apt-get update
- - apt-get -y install build-essential clang libssl-dev openssl
- script:
- - make CC=gcc clean all test
- - make CC=clang clean all test
+Arch Linux:
+ image: archlinux/base
+ extends: .build-generic
+ before_script:
+ - pacman --noconfirm --needed -Syu base-devel clang python
-ubuntu-xenial:
- image: ubuntu:xenial
- stage: build-test-all
- before_script:
- - apt-get update
- - apt-get -y install build-essential clang libssl-dev openssl
- script:
- - make CC=gcc clean all test
- - make CC=clang clean all test
+Debian (stable):
+ image: debian:stable
+ extends: .build-debian-derived
-ubuntu-latest:
- image: ubuntu:latest
- stage: build-test-all
- before_script:
- - apt-get update
- - apt-get -y install build-essential clang libssl-dev openssl
- script:
- - make CC=gcc clean all test
- - make CC=clang clean all test
+Ubuntu (Bionic):
+ image: ubuntu:bionic
+ extends: .build-debian-derived
+
+Ubuntu (Focal):
+ image: ubuntu:focal
+ extends: .build-debian-derived
+
+Shellcheck:
+ image: archlinux/base
+ stage: Test
+ before_script:
+ - pacman --noconfirm --needed -Syu shellcheck
+ script:
+ - ./test/run-shellcheck.sh
+ needs: []
diff --git a/test/run-shellcheck.sh b/test/run-shellcheck.sh
new file mode 100755
index 0000000..1319ba5
--- /dev/null
+++ b/test/run-shellcheck.sh
@@ -0,0 +1,13 @@
+#!/bin/bash -ex
+
+pushd "$(dirname "$0")"
+
+has_error=0
+while IFS= read -d $'\0' -r script ; do
+ echo "$script"
+ if ! shellcheck -e SC1091 "$script" ; then
+ has_error=1
+ fi
+done < <(find .. -name '*.sh' -print0)
+
+exit "$has_error"