-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (100 loc) · 2.88 KB
/
test.yaml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
on:
pull_request:
types: [opened, synchronize, reopened]
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
name: Lint & Test
jobs:
test:
strategy:
matrix:
go-version: [1.23.x]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
check-latest: true
cache: true
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Test
run: |
go test ./...
lint:
strategy:
matrix:
go-version: [1.23.x]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/[email protected]
with:
version: v1.62.2
args: -v --config config/.golangci-no-plugin.yml
lint-plugin:
strategy:
matrix:
go: [1.23.x]
os: [ubuntu-latest]
name: lint-plugin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
check-latest: true
cache: true
- uses: actions/checkout@v4
name: Checkout code
- name: Install golangci-lint
run: |
go install github.com/golangci/golangci-lint/cmd/[email protected]
- name: Build plugin
run: |
go build --buildmode plugin -o cerrl.so plugin/cerrl.go
- name: Run linter
run: |
golangci-lint run -v --out-format github-actions --config config/.golangci-plugin-only.yml
#
# an examlpe for a remote repository
#
# lint-plugin:
# strategy:
# matrix:
# go: [1.23.x]
# os: [ubuntu-latest]
# name: lint-plugin
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/setup-go@v5
# with:
# go-version: ${{ matrix.go }}
# check-latest: true
# cache: true
# - uses: actions/checkout@v4
# name: Checkout code
# - name: Install golangci-lint
# run: |
# go install github.com/golangci/golangci-lint/cmd/[email protected]
# - name: Build plugin
# run: |
# curl -L -o go-lint-cerrl.zip https://github.com/edenlabllc/go-lint-cerrl/archive/refs/tags/v0.1.0.zip
# unzip go-lint-cerrl.zip
# rm go-lint-cerrl.zip
# go build --buildmode plugin -o cerrl.so go-lint-cerrl-0.1.0/plugin/cerrl.go
# rm -r go-lint-cerrl-0.1.0
# - name: Run linter
# run: |
# golangci-lint run -v --timeout 10m --out-format github-actions --config config/.golangci-plugin-only.yml