]> ruderich.org/simon Gitweb - safcm/safcm.git/commitdiff
Add .gitlab-ci.yml
authorSimon Ruderich <simon@ruderich.org>
Sat, 3 Apr 2021 13:06:54 +0000 (15:06 +0200)
committerSimon Ruderich <simon@ruderich.org>
Sat, 3 Apr 2021 13:06:54 +0000 (15:06 +0200)
.gitlab-ci.yml [new file with mode: 0644]
ci/run [new file with mode: 0755]

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644 (file)
index 0000000..10f9811
--- /dev/null
@@ -0,0 +1,15 @@
+.template-docker: &template-docker
+  before_script:
+    - apt-get update
+    - apt-get install --no-install-recommends --yes build-essential ca-certificates git golang golang-1.16 golang-golang-x-tools make
+  script:
+    # NOTE: golang is still using golang-1.15
+    - mkdir -p $HOME/go/bin
+    - ln -sf /usr/lib/go-1.16/bin/go $HOME/go/bin
+    - ln -sf /usr/lib/go-1.16/bin/gofmt $HOME/go/bin
+    #
+    - ./ci/run
+
+debian-sid:
+  <<: *template-docker
+  image: debian:sid
diff --git a/ci/run b/ci/run
new file mode 100755 (executable)
index 0000000..7ec5f16
--- /dev/null
+++ b/ci/run
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+set -eu
+set -x
+
+
+PATH=$HOME/go/bin:$PATH
+export PATH
+
+make
+go test -race ./...
+
+# Additional static checks only run in CI
+go get honnef.co/go/tools/cmd/staticcheck
+staticcheck ./...