-
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.
Merge pull request #2 from anhhuu/fix-handle-panic-and-add-work-flow
Fix handle panic and add work flow
- Loading branch information
Showing
8 changed files
with
459 additions
and
165 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,5 @@ | ||
coverage: | ||
status: | ||
patch: | ||
default: | ||
target: 90% |
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,54 @@ | ||
# This workflow will build a golang project | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | ||
|
||
name: build | ||
|
||
on: | ||
push: | ||
branches: ['main'] | ||
pull_request: | ||
branches: ['main'] | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go 1.21 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
id: go | ||
|
||
- name: Get dependencies | ||
run: | | ||
go get -v -t -d ./... | ||
- name: Build | ||
run: go build -v ./... | ||
|
||
unit-test: | ||
name: Unit Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go 1.21 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
id: go | ||
|
||
- name: Get dependencies | ||
run: | | ||
go get -v -t -d ./... | ||
- name: Run Unit Test | ||
run: go test -v -coverprofile=coverage.out . | ||
|
||
- name: Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
file: ./coverage.out |
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,27 @@ | ||
name: golangci-lint | ||
|
||
on: | ||
pull_request: | ||
branches: ['main'] | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: read | ||
checks: write | ||
|
||
jobs: | ||
lint: | ||
name: Check lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go 1.21 | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.21' | ||
|
||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.54 |
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
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
Oops, something went wrong.