File tree 5 files changed +78
-0
lines changed
5 files changed +78
-0
lines changed Original file line number Diff line number Diff line change
1
+ 1
Original file line number Diff line number Diff line change
1
+ ---
2
+ # See the documentation for more information:
3
+ # https://packit.dev/docs/configuration/
4
+
5
+ jobs :
6
+ # All tests specified in the `/plans/` subdir
7
+ - job : tests
8
+ trigger : pull_request
9
+ # notifications:
10
+ # failure_comment:
11
+ # message: "validate test failed."
12
+ targets : &pr_test_targets
13
+ - fedora-latest-stable
14
+ skip_build : true
15
+ identifier : windows_validate
16
+ tmt_plan : " /plans/validate"
Original file line number Diff line number Diff line change @@ -2,6 +2,15 @@ export GOOS=windows
2
2
export GOARCH =amd64
3
3
SRC = $(shell find . -type f -name '* .go')
4
4
5
+ GOLANGCI_LINT_VERSION := 1.54.2
6
+ .PHONY : .install.golangci-lint
7
+ .install.golangci-lint :
8
+ VERSION=$(GOLANGCI_LINT_VERSION ) ./hack/install_golangci.sh
9
+
10
+ .PHONY : validate
11
+ validate :
12
+ ./bin/golangci-lint run
13
+
5
14
.PHONY : default
6
15
default : build
7
16
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ # This script is intended to be a convenience, to be called from the
4
+ # Makefile `.install.golangci-lint` target. Any other usage is not recommended.
5
+
6
+ die () { echo " ${1:- No error message given} (from $( basename $0 ) )" ; exit 1; }
7
+
8
+ [ -n " $VERSION " ] || die " \$ VERSION is empty or undefined"
9
+
10
+ function install() {
11
+ local retry=$1
12
+
13
+ local msg=" Installing golangci-lint v$VERSION into $BIN "
14
+ if [[ $retry -ne 0 ]]; then
15
+ msg+=" - retry #$retry "
16
+ fi
17
+ echo $msg
18
+
19
+ curl -sSL --retry 5 https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v$VERSION
20
+ }
21
+
22
+ # Undocumented behavior: golangci-lint installer requires $BINDIR in env,
23
+ # will default to ./bin but we can't rely on that.
24
+ export BINDIR=" ./bin"
25
+ BIN=" $BINDIR /golangci-lint"
26
+ if [ ! -x " $BIN " ]; then
27
+ # This flakes much too frequently with "crit unable to find v1.51.1"
28
+ for retry in $( seq 0 5) ; do
29
+ install $retry && exit 0
30
+ sleep 5
31
+ done
32
+ else
33
+ # Prints its own file name as part of --version output
34
+ $BIN --version | grep " $VERSION "
35
+ if [ $? -eq 0 ]; then
36
+ echo " Using existing $BINDIR /$( $BIN --version) "
37
+ else
38
+ install
39
+ fi
40
+ fi
Original file line number Diff line number Diff line change
1
+ prepare:
2
+ - how: install
3
+ package:
4
+ - golang
5
+
6
+ /validate:
7
+ summary: Validate code
8
+ execute:
9
+ how: tmt
10
+ script: |
11
+ make .install.golangci-lint
12
+ make validate
You can’t perform that action at this time.
0 commit comments