-
Notifications
You must be signed in to change notification settings - Fork 16
57 lines (50 loc) · 1.34 KB
/
stage-lint.yml
File metadata and controls
57 lines (50 loc) · 1.34 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
50
51
52
53
54
55
56
57
name: Lint
on:
workflow_call:
permissions:
contents: read
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Set up Go 1.23
uses: actions/setup-go@v3
with:
go-version: 1.23.x
- run: go mod tidy
- name: Fail if go mod not tidy
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "::error go.mod not tidy"
exit 1
fi
# We leverage the golangci-lint action to install
# and maintain the cache,
# but we want to run the command ourselves.
# The action doesn't have an install-only mode,
# so we'll ask it to print its version only.
- name: Install golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.64.7
- name: Lint
run: make lint-golang
check-copyright:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Install pulumictl
uses: jaxxstorm/action-install-gh-release@v1.5.0
with:
repo: pulumi/pulumictl
- name: Set up Go 1.23
uses: actions/setup-go@v3
with:
go-version: 1.23.x
- name: Lint
run: make lint-copyright