-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
56 lines (48 loc) · 1.64 KB
/
Copy pathstatic_analysis.yml
File metadata and controls
56 lines (48 loc) · 1.64 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
name: Static Analysis
on: [push, pull_request]
permissions:
contents: read
env:
CC: "clang"
CGO_LDFLAGS: "-fuse-ld=lld"
jobs:
static_analysis:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: actions/setup-go@v6
with:
go-version: "stable"
- name: Get dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends clang lld libegl1-mesa-dev libgl1-mesa-dev libgles2-mesa-dev libwayland-dev libx11-dev libxkbcommon-dev xorg-dev xvfb language-pack-en
if: ${{ runner.os == 'Linux' }}
- name: Set environment variable LANG
run: echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
if: ${{ runner.os == 'Linux' }}
- name: golangci-lint
if: ${{ runner.os != 'Windows' }} # TODO: On Windows the checks all succeed but there is a compiler issue that cannot be ignored using the configuration.
uses: golangci/golangci-lint-action@v9
with:
args: '--verbose'
- name: Install analysis tools
run: |
go install mvdan.cc/gofumpt@latest
go install golang.org/x/tools/cmd/goimports@latest
go install lucor.dev/lian@latest
- name: Formatting
run: |
gofumpt -d -e .
test -z "$(goimports -e -d . | tee /dev/stderr)"
- name: Check license of dependencies
run: lian -d --allowed="Apache-2.0, BSD-2-Clause, BSD-3-Clause, MIT, ISC"