X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=ci%2Frun;h=67c0e47c74713e8bc775761dd341137e1e3046c7;hb=HEAD;hp=e9cf0ff3f13ca0e2983c62326835389f6f3e765d;hpb=fa33bb263d2998174fcc8c6dd8c44c94b41a8380;p=safcm%2Fsafcm.git diff --git a/ci/run b/ci/run index e9cf0ff..bd89e95 100755 --- a/ci/run +++ b/ci/run @@ -1,5 +1,8 @@ #!/bin/sh +# SPDX-License-Identifier: GPL-3.0-or-later +# Copyright (C) 2021-2024 Simon Ruderich + set -eu set -x @@ -7,10 +10,38 @@ set -x PATH=$HOME/go/bin:$PATH export PATH -make -go vet ./... -go test -race ./... +flags= +if test $# -ne 0; then + flags="$*" +fi + +# Run additional tests in CI +SAFCM_CI_RUN=1 +export SAFCM_CI_RUN + +# shellcheck disable=SC2086 +make $flags +# shellcheck disable=SC2086 +make test $flags +make lint + +# Strict umask +umask 077 +rm -rf ./* +git checkout . +# shellcheck disable=SC2086 +make $flags +# shellcheck disable=SC2086 +make test $flags # Additional static checks only run in CI -go get honnef.co/go/tools/cmd/staticcheck +go install golang.org/x/vuln/cmd/govulncheck@latest +govulncheck ./... +go install honnef.co/go/tools/cmd/staticcheck@v0.4.6 staticcheck ./... +go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2 +golangci-lint run + +test -z "$(git clean -nd)" # any untracked files left? +make clean +test -z "$(git clean -ndx)" # any unignored files left?