Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Commit

Permalink
Add lint/test action (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolerenee authored Sep 29, 2021
1 parent feb0882 commit 0f5a2d2
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
name: Linting and Test

# Run for all pushes to main and pull requests when Go or YAML files change
on:
push:
paths:
- go.mod
- go.sum
- '**.go'
- '**.yaml'
branches:
- main
pull_request:
paths:
- go.mod
- go.sum
- '**.go'
- '**.yaml'

jobs:
golangci:
name: lint-and-test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.17'

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.42
args: --timeout=5m

- name: Run go tests and generate coverage report
run: go test -race -coverprofile=coverage.txt -covermode=atomic -tags testtools -p 1 ./...

- name: Upload coverage report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.txt
flags: unittests
name: codecov-umbrella

0 comments on commit 0f5a2d2

Please sign in to comment.