Skip to content

Commit

Permalink
add build parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
ivvist committed Nov 24, 2024
1 parent 1ce7b36 commit 1a08be7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ Continious Integration action for go- and node- projects

# Stop tests
stop-test: false

#Command to build project
build-cmd: ''
```
## Outputs
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ inputs:
stop-test:
description: 'Does not make test'
default: 'false'
build-cmd:
description: 'command to makke build'
default: ''
outputs:
release_id:
description: 'The ID of the created Release'
Expand Down
12 changes: 8 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ async function run() {
const ignoreRunBuild = core.getInput('ignore-build')
const testfolder = core.getInput('test-folder')
const shorttest = core.getInput ('short-test')
const buildcmd = core.getInput ('build-cmd')

const repositoryOwner = repository.split('/')[0] ||
github.context.payload && github.context.payload.repository && github.context.payload.repository.owner && github.context.payload.repository.owner.login
Expand Down Expand Up @@ -95,14 +96,17 @@ async function run() {
await execute('cd ' + testfolder)
}

if (ignoreRunBuild !== "true") {
await execute('go build ./...')
}

if (runModTidy === "true") {
await execute('go mod tidy')
}

if (ignoreRunBuild !== "true") {
await execute('go build ./...')
}

if (buildcmd === '') {
await execute(buildcmd)
}
// run Codecov / test

if ( codecovToken.length > 0 ) {
Expand Down

0 comments on commit 1a08be7

Please sign in to comment.