Skip to content

Commit 71a5722

Browse files
leogregianinpaemuri
authored andcommitted
Adiciona tests, lint e format do github actions para cada pull request
1 parent 0854135 commit 71a5722

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed

.github/workflows/gofmt.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Format
2+
on: [push, pull_request]
3+
jobs:
4+
format:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- uses: actions/setup-go@v3
9+
with:
10+
go-version: "1.19"
11+
- run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi

.github/workflows/golint.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Lint
2+
on: [push, pull_request]
3+
jobs:
4+
lint:
5+
runs-on: ubuntu-latest
6+
container: golang:1.19-bullseye
7+
steps:
8+
- uses: actions/checkout@v3
9+
- uses: actions/setup-go@v3
10+
with:
11+
go-version: "1.19"
12+
- run: "go install honnef.co/go/tools/cmd/[email protected]"
13+
- run: "staticcheck ./..."

.github/workflows/tests.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
os: [windows-latest, ubuntu-latest]
11+
go: [1.19.x, 1.20.x]
12+
13+
runs-on: ${{ matrix.os }}
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
18+
- uses: actions/setup-go@v3
19+
with:
20+
go-version: ${{ matrix.go }}
21+
22+
- run: go test ./...
23+
if: matrix.os == 'windows-latest'
24+
25+
- run: go test --race ./...
26+
if: matrix.os == 'ubuntu-latest'

0 commit comments

Comments
 (0)