This repository has been archived by the owner on Jul 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
feb0882
commit 0f5a2d2
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |