Skip to content

[CONFIG] [Github Actions] lint and test actions splitted #351

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/go-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: Go CI Tests

on: # yamllint disable-line rule:truthy
push:
branches: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: ["main"]
workflow_dispatch:

env:
LOG_LEVEL: WARN

jobs:
lint:
name: "Go CI LINT"
strategy:
fail-fast: false
matrix:
os: ["windows-2022", "ubuntu-24.04", "macos-14"]
go: ["1.22.x", "1.23.x", "1.24.x"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
check-latest: false

- run: go version

- name: Test Styling (gofmt)
run: gofmt -l . && echo '✔ Your code looks good.'

# yamllint disable rule:line-length
- name: Test Styling (analysis/modernize) Analyzer modernize
if: ${{ ! startsWith(matrix.go, '1.22') }}
run: go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -test ./...
# yamllint enable rule:line-length

- name: Lint (go vet)
run: go vet -v ./...

- name: Lint golangci-lint
uses: golangci/golangci-lint-action@v8
with:
args: --timeout=10m
version: v2.1.0
skip-cache: true
13 changes: 0 additions & 13 deletions .github/workflows/go.yml → .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,6 @@ jobs:
- name: Build
run: go build -v ./...

- name: Lint (gofmt)
run: gofmt -l . && echo '✔ Your code looks good.'

- name: Lint (go vet)
run: go vet -v ./...

- name: Lint golangci-lint
uses: golangci/golangci-lint-action@v8
with:
args: --timeout=10m
version: v2.1.0
skip-cache: true

- name: Test
run: |
go test -v -coverprofile="coverage.out" ./exercises/...
Expand Down