Skip to content

Commit

Permalink
modified ci-action run
Browse files Browse the repository at this point in the history
  • Loading branch information
ivvist committed Nov 17, 2024
1 parent d4cf775 commit 13c7aa9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci_reuse_go_cas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
short_test:
required: false
type: string
ignore_build:
required: false
type: string
go_race:
required: false
type: string
Expand Down Expand Up @@ -67,6 +70,7 @@ jobs:
token: ${{ secrets.reporeading_token }}
codecov-token: ${{ secrets.codecov_token }}
short-test: ${{ secrets.short_test }}
ignore-build: ${{ secrets.ignore_build }}
run-mod-tidy: false
env:
CHARGEBEE_PUBLISHABLE_KEY: ${{ secrets.chargebee_token }}
Expand Down
9 changes: 4 additions & 5 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17335,7 +17335,7 @@ async function run() {
const ignore = getInputAsArray('ignore')
const organization = getInputAsArray('organization')
const token = core.getInput('token')
const codecovToken = core.getInput('codecov-token')
const codecovToken = core.getInput('codecov-token') === ''
const codecovGoRace = core.getInput ('codecov-go-race') === 'true'
const publishAsset = core.getInput('publish-asset')
const publishToken = core.getInput('publish-token')
Expand Down Expand Up @@ -17417,7 +17417,7 @@ async function run() {
}

// run Codecov / test
if (codecovToken) {
if (codecovToken !== "") {
core.startGroup('Codecov')
await execute('go install github.com/heeus/gocov@latest')
let tststr=''
Expand All @@ -17433,16 +17433,15 @@ async function run() {
else
tststr ='go test ./... -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...'

if (shorttest){
if (shorttest == "true"){
tststr=tststr + ' -short'
tststr ='go test ./... -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...'
}
await execute(tststr)
core.endGroup()
await execute(`bash -c "bash <(curl -Os https://uploader.codecov.io/latest/linux/codecov) -t ${codecovToken}"`)
} else {
let tststr='go test ./...'
if (shorttest){
if (shorttest == "true"){
tststr=tststr + ' -short'
}
await execute(tststr)
Expand Down
10 changes: 4 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async function run() {
const ignore = getInputAsArray('ignore')
const organization = getInputAsArray('organization')
const token = core.getInput('token')
const codecovToken = core.getInput('codecov-token')
const codecovToken = core.getInput('codecov-token') === ''
const codecovGoRace = core.getInput ('codecov-go-race') === 'true'
const publishAsset = core.getInput('publish-asset')
const publishToken = core.getInput('publish-token')
Expand Down Expand Up @@ -104,7 +104,7 @@ async function run() {
}

// run Codecov / test
if (codecovToken) {
if (codecovToken !== "") {
core.startGroup('Codecov')
await execute('go install github.com/heeus/gocov@latest')
let tststr=''
Expand All @@ -114,22 +114,20 @@ async function run() {
else
tststr='gocov -t="-covermode=atomic" -v'
*/

if (codecovGoRace)
tststr = 'go test ./... -race -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...'
else
tststr ='go test ./... -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...'

if (shorttest){
if (shorttest == "true"){
tststr=tststr + ' -short'
tststr ='go test ./... -coverprofile=coverage.txt -covermode=atomic -coverpkg=./...'
}
await execute(tststr)
core.endGroup()
await execute(`bash -c "bash <(curl -Os https://uploader.codecov.io/latest/linux/codecov) -t ${codecovToken}"`)
} else {
let tststr='go test ./...'
if (shorttest){
if (shorttest == "true"){
tststr=tststr + ' -short'
}
await execute(tststr)
Expand Down

0 comments on commit 13c7aa9

Please sign in to comment.