Skip to content

Commit

Permalink
fix: workflows (#5)
Browse files Browse the repository at this point in the history
Co-authored-by: raeperd <[email protected]>
  • Loading branch information
ldez and raeperd authored Sep 14, 2024
1 parent e27662d commit f1f57f8
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 20 deletions.
31 changes: 19 additions & 12 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
on: [push]
on:
push:
branches:
- main
pull_request:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [ oldstable, stable ]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: make build
go-version: ${{ matrix.go-version }}
- name: Check and get dependencies
run: |
go mod download
go mod tidy
git diff --exit-code go.mod
git diff --exit-code go.sum
- run: make build
- run: make test
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- uses: sarisia/actions-status-discord@v1
if: always()
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}

lint:
runs-on: ubuntu-latest
Expand All @@ -27,4 +34,4 @@ jobs:
go-version-file: go.mod
- uses: golangci/golangci-lint-action@v6
with:
version: v1.60
version: v1.61
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea/
coverage.txt
cmd/recvcheck/recvcheck
/recvcheck
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
all: build test lint
.PHONY: clean lint test build

download:
go mod download
default: clean lint test build

build: download
go build -C cmd/recvcheck
clean:
rm -rf coverage.txt

test:
build:
go build -ldflags "-s -w" -trimpath ./cmd/recvcheck/

test: clean
go test -race -coverprofile=coverage.txt .

lint:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# recvcheck
[![.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)
[![.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)
Golang linter for check receiver type in method

## Motivtation
Expand Down

0 comments on commit f1f57f8

Please sign in to comment.