Skip to content

Commit f1f57f8

Browse files
ldezraeperd
andauthored
fix: workflows (#5)
Co-authored-by: raeperd <[email protected]>
1 parent e27662d commit f1f57f8

File tree

4 files changed

+30
-20
lines changed

4 files changed

+30
-20
lines changed

.github/workflows/build.yaml

+19-12
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
1-
on: [push]
1+
on:
2+
push:
3+
branches:
4+
- main
5+
pull_request:
26

37
jobs:
48
build:
5-
runs-on: ubuntu-latest
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
go-version: [ oldstable, stable ]
13+
os: [ubuntu-latest, macos-latest, windows-latest]
614
steps:
715
- uses: actions/checkout@v4
816
- uses: actions/setup-go@v5
917
with:
10-
go-version-file: go.mod
11-
- run: make build
18+
go-version: ${{ matrix.go-version }}
19+
- name: Check and get dependencies
20+
run: |
21+
go mod download
22+
go mod tidy
23+
git diff --exit-code go.mod
24+
git diff --exit-code go.sum
25+
- run: make build
1226
- run: make test
13-
- uses: codecov/codecov-action@v4
14-
with:
15-
token: ${{ secrets.CODECOV_TOKEN }}
16-
- uses: sarisia/actions-status-discord@v1
17-
if: always()
18-
with:
19-
webhook: ${{ secrets.DISCORD_WEBHOOK }}
2027

2128
lint:
2229
runs-on: ubuntu-latest
@@ -27,4 +34,4 @@ jobs:
2734
go-version-file: go.mod
2835
- uses: golangci/golangci-lint-action@v6
2936
with:
30-
version: v1.60
37+
version: v1.61

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
.idea/
12
coverage.txt
2-
cmd/recvcheck/recvcheck
3+
/recvcheck

Makefile

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
all: build test lint
1+
.PHONY: clean lint test build
22

3-
download:
4-
go mod download
3+
default: clean lint test build
54

6-
build: download
7-
go build -C cmd/recvcheck
5+
clean:
6+
rm -rf coverage.txt
87

9-
test:
8+
build:
9+
go build -ldflags "-s -w" -trimpath ./cmd/recvcheck/
10+
11+
test: clean
1012
go test -race -coverprofile=coverage.txt .
1113

1214
lint:

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# recvcheck
2-
[![.github/workflows/build.yaml](https://github.com/raeperd/recvcheck/actions/workflows/build.yaml/badge.svg)](https://github.com/raeperd/recvcheck/actions/workflows/build.yaml) [![Go Report Card](https://goreportcard.com/badge/github.com/raeperd/recvcheck)](https://goreportcard.com/report/github.com/raeperd/recvcheck) [![codecov](https://codecov.io/gh/raeperd/recvcheck/graph/badge.svg?token=fPYgEHlq1e)](https://codecov.io/gh/raeperd/recvcheck)
2+
[![.github/workflows/build.yaml](https://github.com/raeperd/recvcheck/actions/workflows/build.yaml/badge.svg)](https://github.com/raeperd/recvcheck/actions/workflows/build.yaml) [![Go Report Card](https://goreportcard.com/badge/github.com/raeperd/recvcheck)](https://goreportcard.com/report/github.com/raeperd/recvcheck)
33
Golang linter for check receiver type in method
44

55
## Motivtation

0 commit comments

Comments
 (0)