Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AST-43499 test codecov scan #947

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Codecov Scan

on:
push:
branches:
- master
pull_request:
workflow_dispatch:

jobs:
run:
runs-on: ubuntu-latest
env:
go-version: 'stable'

steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: ${{ env.go-version }}
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GOPROXY: direct
GONOSUMDB: "*"
GOPRIVATE: https://github.com/CheckmarxDev/ # Add your private organization url here

- name: Install dependencies
run: go install golang.org/x/tools/cmd/cover@latest

- name: Run tests and generate coverage
run: |
git config --global url."https://${{ secrets.GH_TOKEN }}@github.com".insteadOf "https://github.com"
go test ./... -coverpkg=./... -v -coverprofile cover.out


- name: Upload coverage to Codecov
uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed # v4.3.0
with:
token: ${{ secrets.CHECKMARX_ORG_CODECOV_TOKEN }} # create your CODECOV_TOKEN using the token from 'set repo' in codecov site
files: ./cover.out
flags: target=auto
fail_ci_if_error: true
verbose: false
Loading