-
Notifications
You must be signed in to change notification settings - Fork 296
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: mehabhalodiya <mehabhalodiya@gmail.com>
- Loading branch information
1 parent
4ec2bde
commit 307d8ad
Showing
4 changed files
with
109 additions
and
47 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 |
---|---|---|
@@ -1,36 +1,20 @@ | ||
# See http://docs.codecov.io/docs/coverage-configuration | ||
coverage: | ||
precision: 2 # 2 = xx.xx%, 0 = xx% | ||
round: down | ||
# For example: 20...60 would result in any coverage less than 20% | ||
# would have a red background. The color would gradually change to | ||
# green approaching 60%. Any coverage over 60% would result in a | ||
# solid green color. | ||
range: "20...60" | ||
|
||
status: | ||
# project will give us the diff in the total code coverage between a commit | ||
# and its parent | ||
project: yes | ||
# Patch gives just the coverage of the patch | ||
patch: yes | ||
# changes tells us if there are unexpected code co verage changes in other files | ||
# which were not changed by the diff | ||
changes: yes | ||
# allow test coverage to drop by 0.1%, assume that it's typically due to CI problems | ||
patch: | ||
default: | ||
threshold: 0.1 | ||
project: | ||
default: | ||
threshold: 0.1 | ||
|
||
# See http://docs.codecov.io/docs/ignoring-paths | ||
ignore: | ||
- "build/*" | ||
- "hack/*" | ||
- "openshift-ci/*" | ||
- "Makefile" | ||
- ".travis.yml" | ||
|
||
# See http://docs.codecov.io/docs/pull-request-comments-1 | ||
comment: | ||
layout: "diff, files" | ||
behavior: "" | ||
# default = posts once then update, posts new if delete | ||
# once = post once then updates | ||
# new = delete old, post new | ||
# spammy = post new |
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,63 @@ | ||
name: Go | ||
on: | ||
push: | ||
branches: | ||
- "master" | ||
pull_request: | ||
branches: | ||
- "master" | ||
env: | ||
# Golang version to use across CI steps | ||
GOLANG_VERSION: '1.20' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
event_file: | ||
name: "Event File" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Upload | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Event File | ||
path: ${{ github.event_path }} | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v5.0.0 | ||
with: | ||
go-version: ${{ env.GOLANG_VERSION }} | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v4 | ||
|
||
- name: Restore go build cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/go-build | ||
key: ${{ runner.os }}-go-build-v1-${{ github.run_id }} | ||
|
||
- name: Download all Go modules | ||
run: | | ||
go mod download | ||
- name: Generate code coverage artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: code-coverage | ||
path: coverage.out | ||
|
||
- name: Upload code coverage information to codecov.io | ||
uses: codecov/codecov-action@v3.1.4 | ||
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: Go Test on Pull Requests | ||
on: # yamllint disable-line rule:truthy | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
paths: | ||
- '**.go' | ||
workflow_dispatch: | ||
jobs: | ||
gosec: | ||
name: Check GO security | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Run Gosec Security Scanner | ||
uses: securego/gosec@master | ||
with: | ||
args: -exclude-generated ./... | ||
env: | ||
GOROOT: "" |
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