Skip to content

Commit 49c64e6

Browse files
author
Gonzalo Diaz
committed
[CONFIG] [Github Actions] lint and test actions splitted
1 parent 33bb6ad commit 49c64e6

File tree

2 files changed

+52
-13
lines changed

2 files changed

+52
-13
lines changed

.github/workflows/go-lint.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: Go CI Tests
3+
4+
on: # yamllint disable-line rule:truthy
5+
push:
6+
branches: ["main"]
7+
pull_request:
8+
# The branches below must be a subset of the branches above
9+
branches: ["main"]
10+
workflow_dispatch:
11+
12+
env:
13+
LOG_LEVEL: WARN
14+
15+
jobs:
16+
lint:
17+
name: "Go CI LINT"
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
os: ["windows-2022", "ubuntu-24.04", "macos-14"]
22+
go: ["1.22.x", "1.23.x", "1.24.x"]
23+
runs-on: ${{ matrix.os }}
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Set up Go
28+
uses: actions/setup-go@v5
29+
with:
30+
go-version: ${{ matrix.go }}
31+
check-latest: false
32+
33+
- run: go version
34+
35+
- name: Test Styling (gofmt)
36+
if: matrix.go >= '1.23'
37+
run: gofmt -l . && echo '✔ Your code looks good.'
38+
39+
# yamllint disable rule:line-length
40+
- name: Test Styling (analysis/modernize) Analyzer modernize
41+
run: go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -test ./...
42+
# yamllint enable rule:line-length
43+
44+
- name: Lint (go vet)
45+
run: go vet -v ./...
46+
47+
- name: Lint golangci-lint
48+
uses: golangci/golangci-lint-action@v8
49+
with:
50+
args: --timeout=10m
51+
version: v2.1.0
52+
skip-cache: true

.github/workflows/go.yml renamed to .github/workflows/go-test.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,6 @@ jobs:
3535
- name: Build
3636
run: go build -v ./...
3737

38-
- name: Lint (gofmt)
39-
run: gofmt -l . && echo '✔ Your code looks good.'
40-
41-
- name: Lint (go vet)
42-
run: go vet -v ./...
43-
44-
- name: Lint golangci-lint
45-
uses: golangci/golangci-lint-action@v8
46-
with:
47-
args: --timeout=10m
48-
version: v2.1.0
49-
skip-cache: true
50-
5138
- name: Test
5239
run: |
5340
go test -v -coverprofile="coverage.out" ./exercises/...

0 commit comments

Comments
 (0)