mirror of
https://github.com/Slug-Boi/cocommit.git
synced 2026-05-13 12:45:47 +00:00
ci: try and add env var earlier in the workflow
This commit is contained in:
@@ -35,22 +35,24 @@ func main() {
|
|||||||
// set the working directory in the container
|
// set the working directory in the container
|
||||||
// install application dependencies
|
// install application dependencies
|
||||||
runner := source.WithWorkdir("/src_d/src/").
|
runner := source.WithWorkdir("/src_d/src/").
|
||||||
WithExec([]string{"go", "mod", "tidy"})
|
WithExec([]string{"go", "mod", "tidy"}).WithEnvVariable("CI", "true")
|
||||||
|
|
||||||
// run application tests
|
// run application tests
|
||||||
test := runner.WithWorkdir("/src_d/src/").WithExec([]string{"go", "test", "./..."}).WithEnvVariable("CI", "true")
|
test := runner.WithWorkdir("/src_d/src/").WithExec([]string{"go", "test", "./..."})
|
||||||
|
//.WithEnvVariable("CI", "true")
|
||||||
|
|
||||||
buildDir := test.Directory("/src/")
|
buildDir := test.Directory("/src/")
|
||||||
|
|
||||||
for _, goos := range geese {
|
for _, goos := range geese {
|
||||||
path := fmt.Sprintf("/dist/")
|
path := fmt.Sprintf("/dist/")
|
||||||
filename := fmt.Sprintf("/dist/cocommit_go-%s", goos)
|
filename := fmt.Sprintf("/dist/cocommit_go-%s", goos)
|
||||||
// build application
|
// build application
|
||||||
// write the build output to the host
|
// write the build output to the host
|
||||||
build := test.
|
build := test.
|
||||||
WithEnvVariable("GOOS", goos).
|
WithEnvVariable("GOOS", goos).
|
||||||
WithEnvVariable("GOARCH", goarch).
|
WithEnvVariable("GOARCH", goarch).
|
||||||
WithExec([]string{"go", "build", "-o", filename}).WithEnvVariable("CI", "true")
|
WithExec([]string{"go", "build", "-o", filename})
|
||||||
|
//.WithEnvVariable("CI", "true")
|
||||||
|
|
||||||
buildDir = buildDir.WithDirectory(path, build.Directory(path))
|
buildDir = buildDir.WithDirectory(path, build.Directory(path))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user