Skip to content
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
78 changes: 78 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: CI

on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
workflow_dispatch:

jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.22.x', '1.23.x', '1.24.x', '1.25.x']

steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Download dependencies
run: go mod download

- name: Run tests
run: go test -v -race -coverprofile=coverage.out ./...

- name: Upload coverage
uses: codecov/codecov-action@v4
if: matrix.go-version == '1.25.x'
with:
file: ./coverage.out
flags: unittests
fail_ci_if_error: false

# lint:
# name: Lint
# runs-on: ubuntu-latest
# # Skipped for now - golangci-lint doesn't support Go 1.25 yet
# # Will re-enable once golangci-lint releases a version built with Go 1.25
# steps:
# - name: Checkout code
# uses: actions/checkout@v4
#
# - name: Set up Go
# uses: actions/setup-go@v5
# with:
# go-version: '1.24.x'
# cache: true
#
# - name: golangci-lint
# uses: golangci/golangci-lint-action@v6
# with:
# version: latest
# args: --timeout=5m

build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25.x'
cache: true

- name: Build
run: go build -v ./...
31 changes: 0 additions & 31 deletions .github/workflows/go-lint.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/go-test.yml

This file was deleted.

58 changes: 58 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
run:
timeout: 5m
tests: true
modules-download-mode: readonly

linters:
enable:
- errcheck # Check for unchecked errors
- gosimple # Simplify code
- govet # Reports suspicious constructs
- ineffassign # Detects ineffectual assignments
- staticcheck # Go static analysis
- unused # Checks for unused constants, variables, functions and types
- gofmt # Checks if code is gofmt-ed
- goimports # Check import statements are formatted
- misspell # Finds commonly misspelled words
- revive # Fast, configurable, extensible, flexible, and beautiful linter for Go
- typecheck # Type-checks Go code
- gosec # Inspects source code for security problems
- gocritic # Provides diagnostics that check for bugs, performance and style issues

linters-settings:
errcheck:
check-type-assertions: true
check-blank: true

govet:
enable-all: true
disable:
- shadow

revive:
rules:
- name: exported
severity: warning
disabled: false

gosec:
excludes:
- G104 # Allow unhandled errors in some cases (covered by errcheck)

gocritic:
enabled-tags:
- diagnostic
- performance
- style

issues:
exclude-use-default: false
max-issues-per-linter: 0
max-same-issues: 0

# Exclude some linters from running on tests files
exclude-rules:
- path: _test\.go
linters:
- gosec
- errcheck
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/anish749/lazy

go 1.23.2
go 1.25
Loading