]> ruderich.org/simon Gitweb - safcm/safcm.git/blob - ci/run
Use SPDX license identifiers
[safcm/safcm.git] / ci / run
1 #!/bin/sh
2
3 # SPDX-License-Identifier: GPL-3.0-or-later
4 # Copyright (C) 2021-2024  Simon Ruderich
5
6 set -eu
7 set -x
8
9
10 PATH=$HOME/go/bin:$PATH
11 export PATH
12
13 flags=
14 if test $# -ne 0; then
15     flags="$*"
16 fi
17
18 # Run additional tests in CI
19 SAFCM_CI_RUN=1
20 export SAFCM_CI_RUN
21
22 # shellcheck disable=SC2086
23 make $flags
24 # shellcheck disable=SC2086
25 make test $flags
26 make lint
27
28 # Strict umask
29 umask 077
30 rm -rf ./*
31 git checkout .
32 # shellcheck disable=SC2086
33 make $flags
34 # shellcheck disable=SC2086
35 make test $flags
36
37 # Additional static checks only run in CI
38 go install golang.org/x/vuln/cmd/govulncheck@latest
39 govulncheck ./...
40 go install honnef.co/go/tools/cmd/staticcheck@v0.4.6
41 staticcheck ./...
42 go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55.2
43 golangci-lint run
44
45 test -z "$(git clean -nd)" # any untracked files left?
46 make clean
47 test -z "$(git clean -ndx)" # any unignored files left?