Skip to content

Commit 6368688

Browse files
GODRIVER-3493 Unify compile check
1 parent 5695e7e commit 6368688

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

Taskfile.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ tasks:
2828

2929
build-tests: go test -short ${BUILD_TAGS} -run ^$$ ./...
3030

31-
build-compile-check: bash etc/compile_check.sh
31+
build-compile-check: bash etc/compile_check_other.sh
3232

3333
build-compile-check-all: bash etc/run-compile-check-test.sh
3434

etc/compile_check_other.sh

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@
22
set -e # exit when any command fails
33
set -x # show all commands being run
44

5-
GC=go
5+
: ${GO_VERSION:="1.18"} # Default to 1.18 if GO_VERSION is unset or empty
6+
: ${GC:=go$GO_VERSION} # Use existing GC or default to "go$GO_VERSION"
7+
68
COMPILE_CHECK_DIR="internal/cmd/compilecheck"
79
ARCHITECTURES=("386" "arm" "arm64" "ppc64le" "s390x")
810
BUILD_CMD="${GC} build -buildvcs=false"
911

10-
# Compilation modules are not part of the workspace as testcontainers requires
11-
# a version of klauspost/compress not supported by the Go Driver / other modules
12-
# in the workspace.
13-
export GOWORK=off
14-
1512
# compile_check will attempt to build the internal/test/compilecheck project
1613
# using the provided Go version. This is to simulate an end-to-end use case.
1714
function compile_check {

internal/test/compilecheck/compile_check_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ func TestCompileCheck(t *testing.T) {
4949
},
5050
WorkingDir: "/workspace",
5151
Env: map[string]string{
52-
"GO_VERSION": version,
52+
"GC": "go",
53+
// Compilation modules are not part of the workspace as testcontainers requires
54+
// a version of klauspost/compress not supported by the Go Driver / other modules
55+
// in the workspace.
56+
"GOWORK": "off",
5357
},
5458
}
5559

0 commit comments

Comments
 (0)