-
Notifications
You must be signed in to change notification settings - Fork 105
Expand file tree
/
Copy pathaction.yml
More file actions
49 lines (39 loc) · 1.22 KB
/
action.yml
File metadata and controls
49 lines (39 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
name: Lint
description: Lints go-tfe
runs:
using: composite
steps:
- name: Set up Go
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version-file: go.mod
cache: true
- run: make fmtcheck
shell: bash
- name: Install golangci-lint
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/0b5709648c8ba9780e821faf16c5c2bb3262ce3e/install.sh | sh -s -- -b $(go env GOPATH)/bin $GOLANGCILINT_VERSION
shell: bash
env:
GOLANGCILINT_VERSION: v1.64.8
- run: make lint
shell: bash
- name: Ensure generate_mocks.sh ends in a newline
run: test "" = "$(tail -c1 "generate_mocks.sh")"
shell: bash
- name: Install mockgen
shell: bash
run: go install go.uber.org/mock/mockgen@v0.4.0
- name: Get dependencies
shell: bash
run: go mod download
- name: Generate mocks
shell: bash
run: ./generate_mocks.sh
- name: verify go.mod and go.sum are consistent
shell: bash
run : go mod tidy
- name: Ensure mocks are generated
shell: bash
run: git diff --exit-code