Skip to content

Commit

Permalink
Add code climate workflow & file excludes (#47)
Browse files Browse the repository at this point in the history
* 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
elenz97 and martin-helmich authored Jul 14, 2020
1 parent da3e9cb commit da0d89a
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## Exclude auto generated files
exclude_patterns:
- "internal/api/"
- "model/"
42 changes: 42 additions & 0 deletions .github/workflows/codeclimate.yml
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 ./...

0 comments on commit da0d89a

Please sign in to comment.