Skip to content

Commit

Permalink
Feature/ci scan rework (#141)
Browse files Browse the repository at this point in the history
* ci: replaced sonarcloud with codecov
* docs: added codecov badge to readme
* refactor: adjusted file permissions and added nolint
  • Loading branch information
Matthias Nguyen committed May 2, 2021
1 parent 823b482 commit 858d64a
Show file tree
Hide file tree
Showing 5 changed files with 211 additions and 18 deletions.
36 changes: 20 additions & 16 deletions .github/workflows/build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
paths-ignore:
- '**/*.md'
- '**/*.txt'
- 'examples/'
pull_request:
paths-ignore:
- '**/*.md'
Expand All @@ -16,25 +17,25 @@ on:
jobs:
lint:
name: Lint
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

- name: Install golangci-lint
run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.24.0

- name: Run golangci-lint
run: $(go env GOPATH)/bin/golangci-lint run -c .golangci.yml --timeout=5m
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.29
args: --config=".golangci.yml" --timeout=5m

test:
name: Test & Scan
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
go-version: 1.16.3

- name: Check out code
uses: actions/checkout@v2
Expand All @@ -45,22 +46,25 @@ jobs:
- name: Run Unit tests.
run: make test-coverage

- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: CodeCov Scan
uses: codecov/codecov-action@v1
with:
files: ./cover.out
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
verbose: false

build:
name: Build
if: ${{ !github.base_ref }}
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
go-version: 1.16.3

- name: Check out code
uses: actions/checkout@v2
Expand All @@ -71,7 +75,7 @@ jobs:
publish:
name: Publish
if: ${{ !github.base_ref }} # Do not execute on PRs
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
needs: [lint, test, build]
steps:
- name: Check out code
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Kelon is a policy enforcement point, that is wrapping the [Open Policy Agent](https://www.openpolicyagent.org) (OPA) and adding more functionality in terms of microservices.

### Status
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Foundato_kelon&metric=alert_status)](https://sonarcloud.io/dashboard?id=Foundato_kelon)
[![codecov](https://codecov.io/gh/Foundato/kelon/branch/master/graph/badge.svg)](https://codecov.io/gh//Foundato/kelon)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FFoundato%2Fkelon.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FFoundato%2Fkelon?ref=badge_shield)

## Problems you face when applying authorizing to your services
Expand Down

0 comments on commit 858d64a

Please sign in to comment.