From 39b54de6c07accb386663d9a7c2e19ca015dba5e Mon Sep 17 00:00:00 2001 From: Austin Abro Date: Thu, 29 Aug 2024 19:12:09 +0000 Subject: [PATCH 1/9] test import Signed-off-by: Austin Abro --- .github/workflows/test-import.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-import.yaml b/.github/workflows/test-import.yaml index 1cc6784f04..0e8926d0f4 100644 --- a/.github/workflows/test-import.yaml +++ b/.github/workflows/test-import.yaml @@ -25,15 +25,15 @@ jobs: - name: Run test Go program that imports Zarf run: | - cd $(mktemp -d) + cd .. + mkdir test-import + cd test-import echo "$GO_MAIN" > main.go go mod init github.com/zarf-dev/test-import - go mod edit -replace github.com/zarf-dev/zarf=github.com/${{ github.repository }}@${COMMIT_SHA:0:12} + go mod edit -replace github.com/zarf-dev/zarf=../zarf go mod tidy - cat go.mod | grep -q ${COMMIT_SHA:0:12} go run main.go env: - COMMIT_SHA: ${{ github.event.pull_request.head.sha }} GO_MAIN: | package main From 1e8aa8989bb2b558016240a3517f493c03525d11 Mon Sep 17 00:00:00 2001 From: Austin Abro Date: Fri, 30 Aug 2024 14:41:19 +0000 Subject: [PATCH 2/9] trying out go get method Signed-off-by: Austin Abro --- .github/workflows/test-import.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-import.yaml b/.github/workflows/test-import.yaml index 0e8926d0f4..c362de9f73 100644 --- a/.github/workflows/test-import.yaml +++ b/.github/workflows/test-import.yaml @@ -25,15 +25,18 @@ jobs: - name: Run test Go program that imports Zarf run: | + # 9f442cea1f989c62b0ec29ed6d8aded0f747f94e cd .. mkdir test-import cd test-import echo "$GO_MAIN" > main.go go mod init github.com/zarf-dev/test-import - go mod edit -replace github.com/zarf-dev/zarf=../zarf + go get {{ github.event.pull_request.head.repo.name }}@{{ github.event.pull_request.head.sha}} go mod tidy + cat go.mod | grep -q ${COMMIT_SHA:0:12} go run main.go env: + COMMIT_SHA: ${{ github.event.pull_request.head.sha }} GO_MAIN: | package main From 7f886c47f34d0839d43450084916eec2384deb03 Mon Sep 17 00:00:00 2001 From: Austin Abro Date: Fri, 30 Aug 2024 14:42:56 +0000 Subject: [PATCH 3/9] 3457844$ Signed-off-by: Austin Abro --- .github/workflows/test-import.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-import.yaml b/.github/workflows/test-import.yaml index c362de9f73..b7d40f17ff 100644 --- a/.github/workflows/test-import.yaml +++ b/.github/workflows/test-import.yaml @@ -31,7 +31,7 @@ jobs: cd test-import echo "$GO_MAIN" > main.go go mod init github.com/zarf-dev/test-import - go get {{ github.event.pull_request.head.repo.name }}@{{ github.event.pull_request.head.sha}} + go get ${{ github.event.pull_request.head.repo.name }}@${{ github.event.pull_request.head.sha }} go mod tidy cat go.mod | grep -q ${COMMIT_SHA:0:12} go run main.go From c5df02cb931b32df4ad007e2c856b566f509cbc6 Mon Sep 17 00:00:00 2001 From: Austin Abro Date: Fri, 30 Aug 2024 14:45:18 +0000 Subject: [PATCH 4/9] full name Signed-off-by: Austin Abro --- .github/workflows/test-import.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-import.yaml b/.github/workflows/test-import.yaml index b7d40f17ff..744c741c19 100644 --- a/.github/workflows/test-import.yaml +++ b/.github/workflows/test-import.yaml @@ -31,7 +31,7 @@ jobs: cd test-import echo "$GO_MAIN" > main.go go mod init github.com/zarf-dev/test-import - go get ${{ github.event.pull_request.head.repo.name }}@${{ github.event.pull_request.head.sha }} + go get ${{ github.event.pull_request.head.repo.full_name }}@${{ github.event.pull_request.head.sha }} go mod tidy cat go.mod | grep -q ${COMMIT_SHA:0:12} go run main.go From 2c3896e80cba1d04ce9047e9e093787c87776abc Mon Sep 17 00:00:00 2001 From: Austin Abro Date: Fri, 30 Aug 2024 14:46:31 +0000 Subject: [PATCH 5/9] github Signed-off-by: Austin Abro --- .github/workflows/test-import.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-import.yaml b/.github/workflows/test-import.yaml index 744c741c19..fffecb7bf6 100644 --- a/.github/workflows/test-import.yaml +++ b/.github/workflows/test-import.yaml @@ -31,7 +31,7 @@ jobs: cd test-import echo "$GO_MAIN" > main.go go mod init github.com/zarf-dev/test-import - go get ${{ github.event.pull_request.head.repo.full_name }}@${{ github.event.pull_request.head.sha }} + go get github.com/${{ github.event.pull_request.head.repo.full_name }}@${{ github.event.pull_request.head.sha }} go mod tidy cat go.mod | grep -q ${COMMIT_SHA:0:12} go run main.go From 3ff14f4cf26d694b9b7060559db5c789b9b36c5a Mon Sep 17 00:00:00 2001 From: Austin Abro Date: Fri, 30 Aug 2024 14:49:14 +0000 Subject: [PATCH 6/9] make sure this fails Signed-off-by: Austin Abro --- .github/workflows/test-import.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-import.yaml b/.github/workflows/test-import.yaml index fffecb7bf6..b9349d001a 100644 --- a/.github/workflows/test-import.yaml +++ b/.github/workflows/test-import.yaml @@ -25,14 +25,15 @@ jobs: - name: Run test Go program that imports Zarf run: | - # 9f442cea1f989c62b0ec29ed6d8aded0f747f94e cd .. mkdir test-import cd test-import echo "$GO_MAIN" > main.go go mod init github.com/zarf-dev/test-import - go get github.com/${{ github.event.pull_request.head.repo.full_name }}@${{ github.event.pull_request.head.sha }} + # go get github.com/${{ github.event.pull_request.head.repo.full_name }}@${{ github.event.pull_request.head.sha }} + go get github.com/${{ github.event.pull_request.head.repo.full_name }}@9f442cea1f989c62b0ec29ed6d8aded0f747f94e go mod tidy + cat go.mod cat go.mod | grep -q ${COMMIT_SHA:0:12} go run main.go env: From 61b3026fcaa856774e12ad8d55d4c699c64929b7 Mon Sep 17 00:00:00 2001 From: Austin Abro Date: Fri, 30 Aug 2024 14:51:16 +0000 Subject: [PATCH 7/9] back to passing Signed-off-by: Austin Abro --- .github/workflows/test-import.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-import.yaml b/.github/workflows/test-import.yaml index b9349d001a..c122a86a45 100644 --- a/.github/workflows/test-import.yaml +++ b/.github/workflows/test-import.yaml @@ -30,8 +30,7 @@ jobs: cd test-import echo "$GO_MAIN" > main.go go mod init github.com/zarf-dev/test-import - # go get github.com/${{ github.event.pull_request.head.repo.full_name }}@${{ github.event.pull_request.head.sha }} - go get github.com/${{ github.event.pull_request.head.repo.full_name }}@9f442cea1f989c62b0ec29ed6d8aded0f747f94e + go get github.com/${{ github.event.pull_request.head.repo.full_name }}@$COMMIT_SHA go mod tidy cat go.mod cat go.mod | grep -q ${COMMIT_SHA:0:12} From 7936e780df33c080e2cccbe9b5a49f68873f6ed1 Mon Sep 17 00:00:00 2001 From: Austin Abro Date: Fri, 30 Aug 2024 15:00:52 +0000 Subject: [PATCH 8/9] back to temp directory Signed-off-by: Austin Abro --- .github/workflows/test-import.yaml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/test-import.yaml b/.github/workflows/test-import.yaml index c122a86a45..92a88533c6 100644 --- a/.github/workflows/test-import.yaml +++ b/.github/workflows/test-import.yaml @@ -25,14 +25,11 @@ jobs: - name: Run test Go program that imports Zarf run: | - cd .. - mkdir test-import - cd test-import + cd $(mktemp -d) echo "$GO_MAIN" > main.go go mod init github.com/zarf-dev/test-import go get github.com/${{ github.event.pull_request.head.repo.full_name }}@$COMMIT_SHA go mod tidy - cat go.mod cat go.mod | grep -q ${COMMIT_SHA:0:12} go run main.go env: From 0470af84318c51d0bdb9fef224ea678abba89e36 Mon Sep 17 00:00:00 2001 From: Austin Abro Date: Tue, 3 Sep 2024 12:30:45 +0000 Subject: [PATCH 9/9] use go mod edit Signed-off-by: Austin Abro --- .github/workflows/test-import.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-import.yaml b/.github/workflows/test-import.yaml index 92a88533c6..c5571593fe 100644 --- a/.github/workflows/test-import.yaml +++ b/.github/workflows/test-import.yaml @@ -28,7 +28,7 @@ jobs: cd $(mktemp -d) echo "$GO_MAIN" > main.go go mod init github.com/zarf-dev/test-import - go get github.com/${{ github.event.pull_request.head.repo.full_name }}@$COMMIT_SHA + go mod edit -replace github.com/zarf-dev/zarf=github.com/${{ github.event.pull_request.head.repo.full_name }}@${COMMIT_SHA:0:12} go mod tidy cat go.mod | grep -q ${COMMIT_SHA:0:12} go run main.go