Skip to content

Commit 984c22f

Browse files
committed
Updating to newer static analysis workflow
1 parent 9ed5c26 commit 984c22f

File tree

1 file changed

+45
-30
lines changed

1 file changed

+45
-30
lines changed
Lines changed: 45 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,52 @@
11
name: Static Analysis
22
on: [push, pull_request]
3+
permissions:
4+
contents: read
5+
env:
6+
CC: "clang"
7+
CGO_LDFLAGS: "-fuse-ld=lld"
38

49
jobs:
510
checks:
611
runs-on: ubuntu-latest
7-
steps:
8-
- uses: actions/checkout@v4
9-
- uses: actions/setup-go@v5
10-
with:
11-
go-version: 'stable'
12-
13-
- name: Get dependencies
14-
run: |
15-
sudo apt-get update && sudo apt-get install gcc libgl1-mesa-dev libegl1-mesa-dev libgles2-mesa-dev libx11-dev xorg-dev libpam-dev
16-
go install golang.org/x/tools/cmd/goimports@latest
17-
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
18-
go install golang.org/x/lint/golint@latest
19-
go install honnef.co/go/tools/cmd/staticcheck@latest
20-
21-
- name: Cleanup repository
22-
run: rm -rf vendor/
23-
24-
- name: Vet
25-
run: go vet -tags ci ./...
2612

27-
- name: Goimports
28-
run: test -z $(goimports -e -d . | tee /dev/stderr)
29-
30-
- name: Gocyclo
31-
run: gocyclo -over 30 .
32-
33-
- name: Golint
34-
run: golint -set_exit_status $(go list -tags ci ./...)
35-
36-
- name: Staticcheck
37-
run: staticcheck -go 1.19 ./...
13+
steps:
14+
- uses: actions/checkout@v5
15+
with:
16+
persist-credentials: false
17+
- uses: actions/setup-go@v6
18+
with:
19+
go-version: "stable"
20+
21+
- name: Get dependencies
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install --no-install-recommends clang lld libegl1-mesa-dev libgl1-mesa-dev libgles2-mesa-dev libx11-dev xorg-dev xvfb language-pack-en
25+
26+
- name: Set environment variable LANG
27+
run: export LANG=en_EN.UTF-8
28+
29+
- name: Install analysis tools
30+
run: |
31+
go install mvdan.cc/gofumpt@latest
32+
go install golang.org/x/tools/cmd/goimports@latest
33+
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
34+
go install honnef.co/go/tools/cmd/staticcheck@latest
35+
go install lucor.dev/lian@latest
36+
37+
- name: Vet
38+
run: go vet ./...
39+
40+
- name: Formatting
41+
run: |
42+
gofumpt -d -e .
43+
test -z "$(goimports -e -d . | tee /dev/stderr)"
44+
45+
- name: Gocyclo
46+
run: gocyclo -over 30 .
47+
48+
- name: Staticcheck
49+
run: staticcheck ./...
50+
51+
- name: Check license of dependencies
52+
run: lian -d --allowed="Apache-2.0, BSD-2-Clause, BSD-3-Clause, MIT, ISC"

0 commit comments

Comments
 (0)