From: Simon Ruderich Date: Sat, 3 Apr 2021 13:06:54 +0000 (+0200) Subject: Add .gitlab-ci.yml X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=add02385c9c48e7a3d9405b8023e72611e6d5a8f;p=safcm%2Fsafcm.git Add .gitlab-ci.yml --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..10f9811 --- /dev/null +++ b/.gitlab-ci.yml @@ -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 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 ./...