@@ -22,14 +22,14 @@ jobs:
22
22
uses : actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
23
23
with :
24
24
go-version : ${{ matrix.go-version }}
25
-
25
+
26
26
- name : Checkout code
27
27
uses : actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
28
28
29
29
- name : Create test directory
30
30
run : |
31
31
mkdir -p ${{ env.TEST_RESULTS_PATH }}
32
-
32
+
33
33
- name : Setup cache for go modules
34
34
uses : actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
35
35
with :
@@ -39,10 +39,10 @@ jobs:
39
39
key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
40
40
restore-keys : |
41
41
${{ runner.os }}-go-
42
-
42
+
43
43
- name : Download go modules
44
44
run : go mod download
45
-
45
+
46
46
# Check go fmt output because it does not report non-zero when there are fmt changes
47
47
- name : Run gofmt
48
48
run : |
53
53
echo "$files"
54
54
exit 1
55
55
fi
56
-
56
+
57
57
- name : Install gotestsum
58
58
run :
go install gotest.tools/[email protected]
59
59
@@ -71,14 +71,14 @@ jobs:
71
71
workload_identity_provider : ' projects/328212837253/locations/global/workloadIdentityPools/hc-go-getter-test/providers/github-hc-go-getter-test'
72
72
service_account : hc-go-getter-test@hc-e56c0f7c21c448d2be9e7696073.iam.gserviceaccount.com
73
73
audience : https://github.com/hashicorp
74
-
74
+
75
75
- name : Run go tests
76
76
run : |
77
77
PACKAGE_NAMES=$(go list ./...)
78
78
echo "Running $(echo $PACKAGE_NAMES | wc -w) packages"
79
79
echo $PACKAGE_NAMES
80
80
gotestsum --format=short-verbose --junitfile $TEST_RESULTS_PATH/go-getter/gotestsum-report.xml -- -p 2 -cover -coverprofile=linux_cov.part $PACKAGE_NAMES
81
-
81
+
82
82
# Save coverage report parts
83
83
- name : Upload and save artifacts
84
84
uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
@@ -104,7 +104,7 @@ jobs:
104
104
uses : actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
105
105
with :
106
106
go-version : ${{ matrix.go-version }}
107
-
107
+
108
108
- name : Checkout code
109
109
uses : actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
110
110
@@ -120,11 +120,11 @@ jobs:
120
120
121
121
- name : Download go modules
122
122
run : go mod download
123
-
123
+
124
124
- name : Install gotestsum
125
125
shell : bash
126
126
run :
go install gotest.tools/[email protected]
127
-
127
+
128
128
- name : Configure AWS Credentials
129
129
uses : aws-actions/configure-aws-credentials@8c3f20df09ac63af7b3ae3d7c91f105f857d8497 # v4.0.0
130
130
with :
@@ -139,18 +139,28 @@ jobs:
139
139
workload_identity_provider : ' projects/328212837253/locations/global/workloadIdentityPools/hc-go-getter-test/providers/github-hc-go-getter-test'
140
140
service_account : hc-go-getter-test@hc-e56c0f7c21c448d2be9e7696073.iam.gserviceaccount.com
141
141
audience : https://github.com/hashicorp
142
-
142
+
143
143
- name : Run go tests
144
144
shell : bash
145
145
run : |
146
146
PACKAGE_NAMES=$(go list ./...)
147
147
echo "Running $(echo $PACKAGE_NAMES | wc -w) packages"
148
148
echo $PACKAGE_NAMES
149
149
gotestsum --format=short-verbose --junitfile $TEST_RESULTS_PATH/go-getter/gotestsum-report.xml -- -p 2 -cover -race -coverprofile=win_cov.part $PACKAGE_NAMES
150
-
150
+
151
151
# Save coverage report parts
152
152
- name : Upload and save artifacts
153
153
uses : actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
154
154
with :
155
155
name : windows-test-results-${{ matrix.go-version }}
156
- path : win_cov.part
156
+ path : win_cov.part
157
+
158
+ linter :
159
+ runs-on : ubuntu-latest
160
+ steps :
161
+ - name : Checkout code
162
+ uses : actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
163
+ - name : Lint code
164
+ uses : golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
165
+ with :
166
+ args : --enable-only errcheck # this is temporary until the other lint errors are fixed
0 commit comments