-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add code climate workflow & file excludes (#47)
* Add CodeClimate workflow & file excludes * fix indent * Update .codeclimate.yml Co-authored-by: Martin Helmich <[email protected]> Co-authored-by: Martin Helmich <[email protected]>
- Loading branch information
1 parent
da3e9cb
commit da0d89a
Showing
2 changed files
with
46 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,4 @@ | ||
## Exclude auto generated files | ||
exclude_patterns: | ||
- "internal/api/" | ||
- "model/" |
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,42 @@ | ||
name: Go | ||
|
||
# Trigger the workflow on push or pull request | ||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
tags: | ||
- '*' | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go 1.13 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.13 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- name: Hack Code Climate and Go Modules | ||
if: github.event_name != 'pull_request' | ||
run: mkdir -p github.com/mittwald && ln -sf $(pwd) github.com/mittwald/goharbor-client | ||
|
||
- name: Test & publish code coverage | ||
if: github.event_name != 'pull_request' | ||
uses: paambaati/[email protected] | ||
env: | ||
CC_TEST_REPORTER_ID: ${{ secrets.codeClimateReporterID }} | ||
with: | ||
coverageCommand: go test -coverprofile=c.out ./... | ||
debug: true | ||
prefix: 'github.com/${{ github.repository }}/' | ||
|
||
- name: Go Test | ||
if: github.event_name == 'pull_request' | ||
run: go test -coverprofile=c.out ./... |