From cb4a6fd6c7216482f44cf749d246cc000a725131 Mon Sep 17 00:00:00 2001 From: Slug-Boi Date: Fri, 17 May 2024 21:38:27 +0200 Subject: [PATCH 01/10] Add go work init to workflows --- .github/workflows/build_test_release.yml | 2 ++ .github/workflows/test_push.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/build_test_release.yml b/.github/workflows/build_test_release.yml index 95fd30a..ee241ab 100644 --- a/.github/workflows/build_test_release.yml +++ b/.github/workflows/build_test_release.yml @@ -12,6 +12,8 @@ jobs: - name: Setup Go uses: actions/setup-go@v3 - uses: actions/checkout@v3 + - name: Setup Go Workfile + run: go work init ./ci ./src_code/go_src - run: go get dagger.io/dagger@latest - run: mkdir ./dist - run: go run ci/build_test_release.go diff --git a/.github/workflows/test_push.yml b/.github/workflows/test_push.yml index 608a9f1..2dd3420 100644 --- a/.github/workflows/test_push.yml +++ b/.github/workflows/test_push.yml @@ -15,6 +15,8 @@ jobs: - name: Setup Go uses: actions/setup-go@v3 - uses: actions/checkout@v3 + - name: Setup Go Workfile + run: go work init ./ci ./src_code/go_src - name: Get Dagger run: go get dagger.io/dagger@latest - name: Run Dagger Test Workflow From acb17e1b7e22bdfaedfaedcc08f54624a52bddc4 Mon Sep 17 00:00:00 2001 From: Theis <112340858+Slug-Boi@users.noreply.github.com> Date: Fri, 17 May 2024 21:39:27 +0200 Subject: [PATCH 02/10] Delete go.work --- go.work | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 go.work diff --git a/go.work b/go.work deleted file mode 100644 index 7c46f61..0000000 --- a/go.work +++ /dev/null @@ -1,3 +0,0 @@ -go 1.21.0 - -use ./ \ No newline at end of file From cf460715280968f80962ac71d8d25ed5a3452fe0 Mon Sep 17 00:00:00 2001 From: Slug-Boi Date: Fri, 17 May 2024 21:42:33 +0200 Subject: [PATCH 03/10] Added cd to workflow --- .github/workflows/test_push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_push.yml b/.github/workflows/test_push.yml index 2dd3420..9a039a3 100644 --- a/.github/workflows/test_push.yml +++ b/.github/workflows/test_push.yml @@ -18,6 +18,6 @@ jobs: - name: Setup Go Workfile run: go work init ./ci ./src_code/go_src - name: Get Dagger - run: go get dagger.io/dagger@latest + run: cd ci && go get dagger.io/dagger@latest && cd .. - name: Run Dagger Test Workflow run: go run ci/test_on_push.go \ No newline at end of file From 89d8b6fd7879477e8ba027c4d7361227547fda82 Mon Sep 17 00:00:00 2001 From: Slug-Boi Date: Fri, 17 May 2024 21:45:56 +0200 Subject: [PATCH 04/10] update dagger workflow with new go mod path --- ci/test_on_push.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/test_on_push.go b/ci/test_on_push.go index 3181d04..a18e8ff 100644 --- a/ci/test_on_push.go +++ b/ci/test_on_push.go @@ -31,7 +31,7 @@ func main() { // set the working directory in the container // install application dependencies - runner := source.WithWorkdir("/src"). + runner := source.WithWorkdir("/src/src_code/go_src/"). WithExec([]string{"go", "mod", "tidy"}) // run application tests From 44410ca3356873ea2a38e28d74a7c764601f1b44 Mon Sep 17 00:00:00 2001 From: Theis <112340858+Slug-Boi@users.noreply.github.com> Date: Fri, 17 May 2024 21:46:28 +0200 Subject: [PATCH 05/10] Delete go.work.sum --- go.work.sum | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 go.work.sum diff --git a/go.work.sum b/go.work.sum deleted file mode 100644 index 55baeb7..0000000 --- a/go.work.sum +++ /dev/null @@ -1,25 +0,0 @@ -github.com/alexflint/go-arg v1.4.2/go.mod h1:9iRbDxne7LcR/GSvEr7ma++GLpdIU1zrghf2y2768kM= -github.com/alexflint/go-scalar v1.0.0/go.mod h1:GpHzbCOZXEKMEcygYQ5n/aa4Aq84zbxjy3MxYW0gjYw= -github.com/bradleyjkemp/cupaloy/v2 v2.6.0/go.mod h1:bm7JXdkRd4BHJk9HpwqAI8BoAY1lps46Enkdqw6aRX0= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/hashicorp/golang-lru/v2 v2.0.1/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= -github.com/kevinmbeaulieu/eq-go v1.0.0/go.mod h1:G3S8ajA56gKBZm4UB9AOyoOS37JO3roToPzKNM8dtdM= -github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/logrusorgru/aurora/v3 v3.0.0/go.mod h1:vsR12bk5grlLvLXAYrBsb5Oc/N+LxAlxggSjiwMnCUc= -github.com/matryer/moq v0.2.7/go.mod h1:kITsx543GOENm48TUAQyJ9+SAvFSr7iGQXPoth/VUBk= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= -github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/urfave/cli/v2 v2.24.4/go.mod h1:GHupkWPMM0M/sj1a2b4wUrWBPzazNrIjouW6fmdJLxc= -github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673/go.mod h1:N3UwUGtsrSj3ccvlPHLoLsHnpR27oXr4ZE984MbSER8= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From c21b88f89956fb7766d2fb7797a0dab483baf7db Mon Sep 17 00:00:00 2001 From: Slug-Boi Date: Fri, 17 May 2024 21:50:58 +0200 Subject: [PATCH 06/10] update package name to ci --- ci/build_test_release.go | 4 ++-- ci/test_on_push.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/build_test_release.go b/ci/build_test_release.go index 5d1c640..acf3f27 100644 --- a/ci/build_test_release.go +++ b/ci/build_test_release.go @@ -1,4 +1,4 @@ -package main +package ci import ( "context" @@ -34,7 +34,7 @@ func main() { // set the working directory in the container // install application dependencies - runner := source.WithWorkdir("/src"). + runner := source.WithWorkdir("/src/src_code/go_src/"). WithExec([]string{"go", "mod", "tidy"}) // run application tests diff --git a/ci/test_on_push.go b/ci/test_on_push.go index a18e8ff..8589470 100644 --- a/ci/test_on_push.go +++ b/ci/test_on_push.go @@ -1,4 +1,4 @@ -package main +package ci import ( "context" From 37d5c73b4011488f9cdc971b8be5d6bae00c0a16 Mon Sep 17 00:00:00 2001 From: Slug-Boi Date: Fri, 17 May 2024 21:52:04 +0200 Subject: [PATCH 07/10] revert package change for dagger files --- ci/build_test_release.go | 2 +- ci/test_on_push.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/build_test_release.go b/ci/build_test_release.go index acf3f27..2a9eb39 100644 --- a/ci/build_test_release.go +++ b/ci/build_test_release.go @@ -1,4 +1,4 @@ -package ci +package main import ( "context" diff --git a/ci/test_on_push.go b/ci/test_on_push.go index 8589470..a18e8ff 100644 --- a/ci/test_on_push.go +++ b/ci/test_on_push.go @@ -1,4 +1,4 @@ -package ci +package main import ( "context" From 01f1f9488da373f966d46dc31bd98fec2731fb53 Mon Sep 17 00:00:00 2001 From: Slug-Boi Date: Fri, 17 May 2024 21:54:17 +0200 Subject: [PATCH 08/10] Testing if workflows work without go work file --- .github/workflows/test_push.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_push.yml b/.github/workflows/test_push.yml index 9a039a3..24f1739 100644 --- a/.github/workflows/test_push.yml +++ b/.github/workflows/test_push.yml @@ -15,8 +15,8 @@ jobs: - name: Setup Go uses: actions/setup-go@v3 - uses: actions/checkout@v3 - - name: Setup Go Workfile - run: go work init ./ci ./src_code/go_src + # - name: Setup Go Workfile + # run: go work init ./ci ./src_code/go_src - name: Get Dagger run: cd ci && go get dagger.io/dagger@latest && cd .. - name: Run Dagger Test Workflow From c351a6c51e9655e1179c793bb30c562c93584409 Mon Sep 17 00:00:00 2001 From: Slug-Boi Date: Fri, 17 May 2024 21:56:04 +0200 Subject: [PATCH 09/10] Revert "Testing if workflows work without go work file" This reverts commit 01f1f9488da373f966d46dc31bd98fec2731fb53. --- .github/workflows/test_push.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_push.yml b/.github/workflows/test_push.yml index 24f1739..9a039a3 100644 --- a/.github/workflows/test_push.yml +++ b/.github/workflows/test_push.yml @@ -15,8 +15,8 @@ jobs: - name: Setup Go uses: actions/setup-go@v3 - uses: actions/checkout@v3 - # - name: Setup Go Workfile - # run: go work init ./ci ./src_code/go_src + - name: Setup Go Workfile + run: go work init ./ci ./src_code/go_src - name: Get Dagger run: cd ci && go get dagger.io/dagger@latest && cd .. - name: Run Dagger Test Workflow From e132e5325c24cd14af6da416a26e6ae9017c61fd Mon Sep 17 00:00:00 2001 From: Slug-Boi Date: Fri, 17 May 2024 21:58:13 +0200 Subject: [PATCH 10/10] Remove ci from exclude list for workflows --- ci/build_test_release.go | 2 +- ci/test_on_push.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/build_test_release.go b/ci/build_test_release.go index 2a9eb39..aed7cbb 100644 --- a/ci/build_test_release.go +++ b/ci/build_test_release.go @@ -26,7 +26,7 @@ func main() { source := client.Container(). From("golang:1.21"). WithDirectory("/src", client.Host().Directory(".", dagger.HostDirectoryOpts{ - Exclude: []string{"ci/"}, + Exclude: []string{}, })).WithMountedCache("/src/dagger_dep_cache/go_dep", goCache) geese := []string{"darwin", "linux", "windows"} diff --git a/ci/test_on_push.go b/ci/test_on_push.go index a18e8ff..7a4e37d 100644 --- a/ci/test_on_push.go +++ b/ci/test_on_push.go @@ -26,7 +26,7 @@ func main() { source := client.Container(). From("golang:1.21"). WithDirectory("/src", client.Host().Directory(".", dagger.HostDirectoryOpts{ - Exclude: []string{"ci/", "build/"}, + Exclude: []string{"build/"}, })).WithMountedCache("/src/dagger_dep_cache/go_dep", goCache) // set the working directory in the container