-
Notifications
You must be signed in to change notification settings - Fork 12
48 lines (43 loc) · 1.19 KB
/
stage-lint.yml
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
name: Lint
on:
workflow_call:
permissions: read-all
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
lint:
container: golangci/golangci-lint:latest
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Set up Go 1.19.x
uses: actions/setup-go@v3
with:
go-version: 1.19.x
- run: go mod tidy -compat=1.17
- name: Fail if god mod not tidy
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "::error go.mod not tidy"
exit 1
fi
- name: Lint
run: |
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.49.0
make lint-golang || true
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.18.x
uses: actions/setup-go@v3
with:
go-version: 1.18.x
- name: Lint
run: make lint-copyright