Skip to content

Commit

Permalink
Adiciona tests, lint e format do github actions para cada pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
leogregianin authored and paemuri committed Dec 24, 2023
1 parent 0854135 commit 71a5722
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/gofmt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Format
on: [push, pull_request]
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "1.19"
- run: if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then exit 1; fi
13 changes: 13 additions & 0 deletions .github/workflows/golint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Lint
on: [push, pull_request]
jobs:
lint:
runs-on: ubuntu-latest
container: golang:1.19-bullseye
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: "1.19"
- run: "go install honnef.co/go/tools/cmd/[email protected]"
- run: "staticcheck ./..."
26 changes: 26 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Tests

on: [push, pull_request]

jobs:
test:
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
go: [1.19.x, 1.20.x]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3

- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}

- run: go test ./...
if: matrix.os == 'windows-latest'

- run: go test --race ./...
if: matrix.os == 'ubuntu-latest'

0 comments on commit 71a5722

Please sign in to comment.