-
-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (47 loc) · 1.37 KB
/
basic.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
49
50
51
52
53
54
name: golangci-lint
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
jobs:
linter:
name: golangci-lint
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [stable, oldstable ]
os: [ubuntu-latest, macos-latest] # Go plugins are only supported on linux, freebsd, and darwin.
env:
CGO_ENABLED: 0
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Check and get dependencies
run: |
go mod tidy
git diff --exit-code go.mod
# git diff --exit-code go.sum
- name: Install plugins
run: |
git clone https://github.com/golangci/example-plugin-linter.git
cd example-plugin-linter
go build -o '${{ github.workspace }}/.plugins/example.so' -buildmode=plugin plugin/example.go
working-directory: ${{ runner.temp }}
env:
CGO_ENABLED: 1
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59.1
# The installation mode `goinstall` always uses `CGO_ENABLED=1`.
install-mode: goinstall
args: --timeout=10m
- name: Test
run: go test -v -cover ./...
- name: Build
run: go build -v -ldflags "-s -w" -trimpath