Skip to content

Commit fe09318

Browse files
authored
Merge pull request #97 from blinklabs-io/ci/update-golangci-lint
ci: update golangci-lint and split go-test to separate workflow
2 parents 9ff7e2a + 1a81c39 commit fe09318

File tree

2 files changed

+38
-15
lines changed

2 files changed

+38
-15
lines changed

.github/workflows/go-test.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: go-test
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
branches:
8+
- main
9+
pull_request:
10+
11+
jobs:
12+
go-test:
13+
name: go-test
14+
strategy:
15+
matrix:
16+
go-version: [1.20.x, 1.21.x]
17+
# XXX: is it actually useful to run unit tests on macOS?
18+
platform: [ubuntu-latest, macos-latest]
19+
runs-on: ${{ matrix.platform }}
20+
steps:
21+
- uses: actions/checkout@v3
22+
- uses: actions/setup-go@v4
23+
with:
24+
go-version: ${{ matrix.go-version }}
25+
- name: go-test
26+
run: go test ./...
Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,33 @@
11
# This file was copied from the following URL and modified:
22
# https://github.com/golangci/golangci-lint-action/blob/master/README.md#how-to-use
33

4-
name: golangci
4+
name: golangci-lint
55
on:
66
push:
77
tags:
88
- v*
99
branches:
10-
- master
1110
- main
1211
pull_request:
12+
1313
permissions:
1414
contents: read
1515
pull-requests: read
16+
1617
jobs:
1718
golangci:
1819
name: lint
19-
strategy:
20-
matrix:
21-
go-version: [1.20.x, 1.21.x]
22-
platform: [ubuntu-latest, macos-latest]
23-
runs-on: ${{ matrix.platform }}
20+
runs-on: ubuntu-latest
2421
steps:
25-
- uses: actions/checkout@v2
26-
- uses: actions/setup-go@v3
22+
- uses: actions/checkout@v3
23+
- uses: actions/setup-go@v4
2724
with:
28-
go-version: ${{ matrix.go-version }}
25+
go-version: 1.21.x
26+
cache: false
2927
- name: golangci-lint
3028
uses: golangci/golangci-lint-action@v3
3129
with:
32-
version: v1.53.3 # current version at time of commit
33-
args: --timeout 10m
34-
only-new-issues: true
35-
- name: go-test
36-
run: go test ./...
30+
version: v1.54 # current version at time of commit
31+
args: --timeout=10m
32+
# Only show new issues in a PR but show all issues for pushes
33+
only-new-issues: ${{ github.event_name == 'pull_request' && 'true' || 'false' }}

0 commit comments

Comments
 (0)