Skip to content

Commit 46bf4d3

Browse files
committed
ci: improve Go project CI consistency and cross-platform support
- Add .gitattributes to enforce LF line endings for Go files - Update lint job in workflow to run on multiple operating systems using a matrix strategy - Switch Go version setup to use matrix variable and remove check-latest and go-version-file options Signed-off-by: appleboy <[email protected]>
1 parent f3ceddb commit 46bf4d3

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.go text eol=lf

.github/workflows/testing.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ concurrency:
1515

1616
jobs:
1717
lint:
18-
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
go: [stable]
21+
os: [ubuntu-latest, macos-latest, windows-latest]
22+
runs-on: ${{ matrix.os }}
23+
name: lint
1924
steps:
2025
- name: Checkout repository
2126
uses: actions/checkout@v4
@@ -25,8 +30,8 @@ jobs:
2530
- name: Setup go
2631
uses: actions/setup-go@v5
2732
with:
28-
go-version-file: go.mod
29-
check-latest: true
33+
go-version: ${{ matrix.go }}
34+
3035
- name: Setup golangci-lint
3136
uses: golangci/golangci-lint-action@v8
3237
with:

0 commit comments

Comments
 (0)