Skip to content

Commit

Permalink
Added go workflow to test the code
Browse files Browse the repository at this point in the history
  • Loading branch information
jnbdz committed Mar 13, 2024
1 parent 1b7a9d7 commit ff71f8d
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Go

on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master ]

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.22' # Use the Go version of your project
- name: Check out code
uses: actions/checkout@v2
- name: Cache Go modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.56.2 # Use the version of golangci-lint you want
args: --config .golangci.yml ./... # Optional: specify config file and directories to lint
- name: Run Tests
run: go test -v ./...
20 changes: 20 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
linters-settings:
govet:
check-shadowing: true
golint:
min-confidence: 0.8

linters:
enable:
- govet
- golint
- gofmt
- goimports
disable:
- errcheck

issues:
exclude-rules:
- linters:
- golint
text: "should have comment or be unexported" # Example: exclude a specific rule

0 comments on commit ff71f8d

Please sign in to comment.