From 912c030421004354a6de383c2dcd480aca99a149 Mon Sep 17 00:00:00 2001 From: Dan Chao Date: Tue, 18 Jun 2024 11:42:22 -0700 Subject: [PATCH 1/7] Support Windows paths, add CI for Windows --- .circleci/config.pkl | 45 +++++++++++++++- pkl/module_source.go | 27 ---------- pkl/module_source_unix.go | 49 ++++++++++++++++++ ...rce_test.go => module_source_unix_test.go} | 1 + pkl/module_source_windows.go | 51 +++++++++++++++++++ pkl/module_source_windows_test.go | 30 +++++++++++ 6 files changed, 174 insertions(+), 29 deletions(-) create mode 100644 pkl/module_source_unix.go rename pkl/{module_source_test.go => module_source_unix_test.go} (98%) create mode 100644 pkl/module_source_windows.go create mode 100644 pkl/module_source_windows_test.go diff --git a/.circleci/config.pkl b/.circleci/config.pkl index d54da7a..4019b6e 100644 --- a/.circleci/config.pkl +++ b/.circleci/config.pkl @@ -1,4 +1,6 @@ -amends "package://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.circleci@1.0.2#/PklCI.pkl" +amends "package://pkg.pkl-lang.org/pkl-project-commons/pkl.impl.circleci@1.1.1#/PklCI.pkl" + +import "pkl:semver" local testJobs = jobs.keys.filter((it) -> it.startsWith("test")) @@ -14,13 +16,23 @@ local class PklDistribution { /// The version of this distribution version: String + /// The parsed semver. + fixed _version: semver.Version = semver.parseOrNull(version)!! + /// The URL to download this distribution fixed downloadUrl: String = "https://github.com/apple/pkl/releases/download/\(version)/pkl-linux-amd64" + + /// The URL to download this distribution + fixed downloadUrlWindows: String = + if (_version.minor < 26) throw("\(version) is not supported on Windows") + else "https://github.com/apple/pkl/releases/download/\(version)/pkl-windows-amd64.exe" } +local distributionLatest: PklDistribution = new { version = "0.26.0" } + local pklDistributions: Listing = new { new { version = "0.25.3" } - new { version = "0.26.0" } + distributionLatest } release = (buildWorkflow) { @@ -72,6 +84,35 @@ jobs { } } } + ["test-windows"] { + machine { + image = "windows-server-2022-gui:current" + } + resource_class = "windows.medium" + steps { + "checkout" + new RunStep { command = "systeminfo" } + new RunStep { + name = "go test" + command = #""" + echo "Installing Go" + Invoke-WebRequest "https://go.dev/dl/go1.21.11.windows-386.msi" -OutFile go.exe + $pkg = "$PWD\go.exe" + Start-Process msiexec "/i $pkg /qn"; + + echo "Installing Pkl" + Invoke-WebRequest "\#(distributionLatest.downloadUrlWindows)" -OutFile pkl.exe + $env:PKL_EXEC = "$PWD\pkl.exe" + + echo "Running Pkl unit tests" + .\pkl test --junit-reports test-results\ --project-dir codegen\src\ + + echo "Running Go unit tests" + go test -race -v .\... 2>&1 | go-junit-report -iocopy -set-exit-code -out test-results\go-test-results.xml + """# + } + } + } ["build-pkl-gen-go"] = (goJob) { steps { for (os in List("macos", "linux")) { diff --git a/pkl/module_source.go b/pkl/module_source.go index f777122..312536b 100644 --- a/pkl/module_source.go +++ b/pkl/module_source.go @@ -18,8 +18,6 @@ package pkl import ( "net/url" - "os" - "path" ) // ModuleSource represents a source for Pkl evaluation. @@ -34,31 +32,6 @@ type ModuleSource struct { Contents string } -// FileSource builds a ModuleSource, treating its arguments as paths on the file system. -// -// If the provided path is not an absolute path, it will be resolved against the current working -// directory. -// -// If multiple path arguments are provided, they are joined as multiple elements of the path. -// -// It panics if the current working directory cannot be resolved. -func FileSource(pathElems ...string) *ModuleSource { - src := path.Join(pathElems...) - if !path.IsAbs(src) { - p, err := os.Getwd() - if err != nil { - panic(err) - } - src = path.Join(p, src) - } - return &ModuleSource{ - Uri: &url.URL{ - Scheme: "file", - Path: src, - }, - } -} - // TextSource builds a ModuleSource whose contents are the provided text. func TextSource(text string) *ModuleSource { return &ModuleSource{ diff --git a/pkl/module_source_unix.go b/pkl/module_source_unix.go new file mode 100644 index 0000000..ee04b50 --- /dev/null +++ b/pkl/module_source_unix.go @@ -0,0 +1,49 @@ +// ===----------------------------------------------------------------------===// +// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ===----------------------------------------------------------------------===// + +//go:build unix +package pkl + +import ( + "net/url" + "os" + "path" +) + +// FileSource builds a ModuleSource, treating its arguments as paths on the file system. +// +// If the provided path is not an absolute path, it will be resolved against the current working +// directory. +// +// If multiple path arguments are provided, they are joined as multiple elements of the path. +// +// It panics if the current working directory cannot be resolved. +func FileSource(pathElems ...string) *ModuleSource { + src := path.Join(pathElems...) + if !path.IsAbs(src) { + p, err := os.Getwd() + if err != nil { + panic(err) + } + src = path.Join(p, src) + } + return &ModuleSource{ + Uri: &url.URL{ + Scheme: "file", + Path: src, + }, + } +} diff --git a/pkl/module_source_test.go b/pkl/module_source_unix_test.go similarity index 98% rename from pkl/module_source_test.go rename to pkl/module_source_unix_test.go index aea9f12..d925731 100644 --- a/pkl/module_source_test.go +++ b/pkl/module_source_unix_test.go @@ -14,6 +14,7 @@ // limitations under the License. // ===----------------------------------------------------------------------===// +//go:build unix package pkl import ( diff --git a/pkl/module_source_windows.go b/pkl/module_source_windows.go new file mode 100644 index 0000000..1f7c17a --- /dev/null +++ b/pkl/module_source_windows.go @@ -0,0 +1,51 @@ +// ===----------------------------------------------------------------------===// +// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ===----------------------------------------------------------------------===// + +package pkl + +import ( + "net/url" + "os" + "path/filepath" + "strings" +) + +// FileSource builds a ModuleSource, treating its arguments as paths on the file system. +// +// If the provided path is not an absolute path, it will be resolved against the current working +// directory. +// +// If multiple path arguments are provided, they are joined as multiple elements of the path. +// +// It panics if the current working directory cannot be resolved. +func FileSource(pathElems ...string) *ModuleSource { + src := filepath.Join(pathElems...) + // TODO: this can possibly be wrong because the path can be a UNC path. + if !filepath.IsAbs(src) { + p, err := os.Getwd() + if err != nil { + panic(err) + } + src = filepath.Join(p, src) + } + return &ModuleSource{ + Uri: &url.URL{ + Scheme: "file", + Path: "/" + strings.ReplaceAll(src, "\\", "/"), + }, + } +} + diff --git a/pkl/module_source_windows_test.go b/pkl/module_source_windows_test.go new file mode 100644 index 0000000..86a4fce --- /dev/null +++ b/pkl/module_source_windows_test.go @@ -0,0 +1,30 @@ +// ===----------------------------------------------------------------------===// +// Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ===----------------------------------------------------------------------===// + +package pkl + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func Test_PathSource(t *testing.T) { + src := FileSource("C:\\path\\to\\myfile.pkl") + assert.Equal(t, "file:///C:/path/to/myfile.pkl", src.Uri.String()) + src = FileSource("C:\\path", "to", "lib", "myotherfile.pkl") + assert.Equal(t, "file:///C:/path/to/lib/myotherfile.pkl", src.Uri.String()) +} From 4377ab623fb3336ff37621bde62c449a6c4aae88 Mon Sep 17 00:00:00 2001 From: Dan Chao Date: Thu, 20 Jun 2024 13:04:57 -0700 Subject: [PATCH 2/7] WIP test windows --- .circleci/config.pkl | 52 +++++++++++----------- .circleci/config.yml | 103 +++++++++++++++++++++---------------------- 2 files changed, 76 insertions(+), 79 deletions(-) diff --git a/.circleci/config.pkl b/.circleci/config.pkl index 4019b6e..60c1a5e 100644 --- a/.circleci/config.pkl +++ b/.circleci/config.pkl @@ -60,30 +60,30 @@ triggerDocsBuild = "release" triggerPackageDocsBuild = "release" jobs { - for (distribution in pklDistributions) { - ["test-pkl-\(distribution.version.replaceAll(".", "-"))"] = (goJob) { - steps { - new RunStep { - name = "go test" - command = """ - curl -L -o pkl.bin '\(distribution.downloadUrl)' - chmod +x pkl.bin - export PKL_EXEC=$(pwd)/pkl.bin - go install github.com/jstemmer/go-junit-report/v2@latest - echo "Running Pkl unit tests" - $PKL_EXEC test --junit-reports test-results/ codegen/src/tests/*.pkl - echo "Running Pkl snippet tests" - ./scripts/test_snippets.sh - echo "Running Go unit tests" - go test -race -v ./... 2>&1 | go-junit-report -iocopy -set-exit-code -out test-results/go-test-results.xml - """ - } - new StoreTestResults { - path = "test-results" - } - } - } - } +// for (distribution in pklDistributions) { +// ["test-pkl-\(distribution.version.replaceAll(".", "-"))"] = (goJob) { +// steps { +// new RunStep { +// name = "go test" +// command = """ +// curl -L -o pkl.bin '\(distribution.downloadUrl)' +// chmod +x pkl.bin +// export PKL_EXEC=$(pwd)/pkl.bin +// go install github.com/jstemmer/go-junit-report/v2@latest +// echo "Running Pkl unit tests" +// $PKL_EXEC test --junit-reports test-results/ codegen/src/tests/*.pkl +// echo "Running Pkl snippet tests" +// ./scripts/test_snippets.sh +// echo "Running Go unit tests" +// go test -race -v ./... 2>&1 | go-junit-report -iocopy -set-exit-code -out test-results/go-test-results.xml +// """ +// } +// new StoreTestResults { +// path = "test-results" +// } +// } +// } +// } ["test-windows"] { machine { image = "windows-server-2022-gui:current" @@ -115,12 +115,12 @@ jobs { } ["build-pkl-gen-go"] = (goJob) { steps { - for (os in List("macos", "linux")) { + for (os in List("macos", "linux", "windows")) { for (arch in List("amd64", "aarch64")) { new RunStep { name = "go build \(os) \(arch)" environment { - ["GOOS"] = if (os == "linux") os else "darwin" + ["GOOS"] = if (os == "linux" || os == "windows") os else "darwin" ["GOARCH"] = if (arch == "amd64") arch else "arm64" } command = #""" diff --git a/.circleci/config.yml b/.circleci/config.yml index e532388..9fea672 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,46 +3,31 @@ version: '2.1' orbs: pr-approval: apple/pr-approval@0.1.0 jobs: - test-pkl-0-25-3: + test-windows: steps: - checkout - run: - command: |- - curl -L -o pkl.bin 'https://github.com/apple/pkl/releases/download/0.25.3/pkl-linux-amd64' - chmod +x pkl.bin - export PKL_EXEC=$(pwd)/pkl.bin - go install github.com/jstemmer/go-junit-report/v2@latest - echo "Running Pkl unit tests" - $PKL_EXEC test --junit-reports test-results/ codegen/src/tests/*.pkl - echo "Running Pkl snippet tests" - ./scripts/test_snippets.sh - echo "Running Go unit tests" - go test -race -v ./... 2>&1 | go-junit-report -iocopy -set-exit-code -out test-results/go-test-results.xml - name: go test - - store_test_results: - path: test-results - docker: - - image: cimg/go:1.21 - test-pkl-0-26-0: - steps: - - checkout + command: systeminfo - run: command: |- - curl -L -o pkl.bin 'https://github.com/apple/pkl/releases/download/0.26.0/pkl-linux-amd64' - chmod +x pkl.bin - export PKL_EXEC=$(pwd)/pkl.bin - go install github.com/jstemmer/go-junit-report/v2@latest + echo "Installing Go" + Invoke-WebRequest "https://go.dev/dl/go1.21.11.windows-386.msi" -OutFile go.exe + $pkg = "$PWD\go.exe" + Start-Process msiexec "/i $pkg /qn"; + + echo "Installing Pkl" + Invoke-WebRequest "https://github.com/apple/pkl/releases/download/0.26.0/pkl-windows-amd64.exe" -OutFile pkl.exe + $env:PKL_EXEC = "$PWD\pkl.exe" + echo "Running Pkl unit tests" - $PKL_EXEC test --junit-reports test-results/ codegen/src/tests/*.pkl - echo "Running Pkl snippet tests" - ./scripts/test_snippets.sh + .\pkl test --junit-reports test-results\ --project-dir codegen\src\ + echo "Running Go unit tests" - go test -race -v ./... 2>&1 | go-junit-report -iocopy -set-exit-code -out test-results/go-test-results.xml + go test -race -v .\... 2>&1 | go-junit-report -iocopy -set-exit-code -out test-results\go-test-results.xml name: go test - - store_test_results: - path: test-results - docker: - - image: cimg/go:1.21 + resource_class: windows.medium + machine: + image: windows-server-2022-gui:current build-pkl-gen-go: steps: - checkout @@ -98,6 +83,32 @@ jobs: environment: GOOS: linux GOARCH: arm64 + - run: + command: |- + # strip preceding "v" + VERSION="${CIRCLE_TAG:1}" + + go build \ + -o out/pkl-gen-go/pkl-gen-go-windows-amd64.bin \ + -ldflags="-X 'main.Version=$VERSION'" \ + cmd/pkl-gen-go/pkl-gen-go.go + name: go build windows amd64 + environment: + GOOS: windows + GOARCH: amd64 + - run: + command: |- + # strip preceding "v" + VERSION="${CIRCLE_TAG:1}" + + go build \ + -o out/pkl-gen-go/pkl-gen-go-windows-aarch64.bin \ + -ldflags="-X 'main.Version=$VERSION'" \ + cmd/pkl-gen-go/pkl-gen-go.go + name: go build windows aarch64 + environment: + GOOS: windows + GOARCH: arm64 - persist_to_workspace: root: '.' paths: @@ -212,10 +223,7 @@ workflows: type: approval - pr-approval/authenticate: context: pkl-pr-approval - - test-pkl-0-25-3: - requires: - - hold - - test-pkl-0-26-0: + - test-windows: requires: - hold when: @@ -224,29 +232,20 @@ workflows: pattern: ^pull/\d+(/head)?$ main: jobs: - - test-pkl-0-25-3 - - test-pkl-0-26-0 + - test-windows - build-pkl-gen-go: requires: - - test-pkl-0-25-3 - - test-pkl-0-26-0 + - test-windows - build-pkl-package: requires: - - test-pkl-0-25-3 - - test-pkl-0-26-0 + - test-windows when: equal: - main - << pipeline.git.branch >> release: jobs: - - test-pkl-0-25-3: - filters: - branches: - ignore: /.*/ - tags: - only: /^v?\d+\.\d+\.\d+$/ - - test-pkl-0-26-0: + - test-windows: filters: branches: ignore: /.*/ @@ -254,8 +253,7 @@ workflows: only: /^v?\d+\.\d+\.\d+$/ - build-pkl-gen-go: requires: - - test-pkl-0-25-3 - - test-pkl-0-26-0 + - test-windows filters: branches: ignore: /.*/ @@ -263,8 +261,7 @@ workflows: only: /^v?\d+\.\d+\.\d+$/ - build-pkl-package: requires: - - test-pkl-0-25-3 - - test-pkl-0-26-0 + - test-windows filters: branches: ignore: /.*/ From 29aad9a8c545f7a0f0e9c6138210bcf0a0eb0bdf Mon Sep 17 00:00:00 2001 From: Dan Chao Date: Thu, 20 Jun 2024 13:11:28 -0700 Subject: [PATCH 3/7] Specify shell --- .circleci/config.pkl | 2 +- .circleci/config.yml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.circleci/config.pkl b/.circleci/config.pkl index 60c1a5e..1a9abf8 100644 --- a/.circleci/config.pkl +++ b/.circleci/config.pkl @@ -91,9 +91,9 @@ jobs { resource_class = "windows.medium" steps { "checkout" - new RunStep { command = "systeminfo" } new RunStep { name = "go test" + shell = "powershell.exe" command = #""" echo "Installing Go" Invoke-WebRequest "https://go.dev/dl/go1.21.11.windows-386.msi" -OutFile go.exe diff --git a/.circleci/config.yml b/.circleci/config.yml index 9fea672..fc7eb2d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,8 +6,6 @@ jobs: test-windows: steps: - checkout - - run: - command: systeminfo - run: command: |- echo "Installing Go" @@ -25,6 +23,7 @@ jobs: echo "Running Go unit tests" go test -race -v .\... 2>&1 | go-junit-report -iocopy -set-exit-code -out test-results\go-test-results.xml name: go test + shell: powershell.exe resource_class: windows.medium machine: image: windows-server-2022-gui:current From ed7575dfe99db4c6a2cf944eb2bf971a62c650d2 Mon Sep 17 00:00:00 2001 From: Dan Chao Date: Thu, 20 Jun 2024 13:28:09 -0700 Subject: [PATCH 4/7] Adjustment --- .circleci/config.pkl | 5 ++++- .circleci/config.yml | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.circleci/config.pkl b/.circleci/config.pkl index 1a9abf8..daaa24c 100644 --- a/.circleci/config.pkl +++ b/.circleci/config.pkl @@ -24,7 +24,7 @@ local class PklDistribution { /// The URL to download this distribution fixed downloadUrlWindows: String = - if (_version.minor < 26) throw("\(version) is not supported on Windows") + if (_version.minor < 26) throw("Pkl \(version) is not supported on Windows") else "https://github.com/apple/pkl/releases/download/\(version)/pkl-windows-amd64.exe" } @@ -107,6 +107,9 @@ jobs { echo "Running Pkl unit tests" .\pkl test --junit-reports test-results\ --project-dir codegen\src\ + echo "Installing go-junit-report" + go install github.com/jstemmer/go-junit-report/v2@latest + echo "Running Go unit tests" go test -race -v .\... 2>&1 | go-junit-report -iocopy -set-exit-code -out test-results\go-test-results.xml """# diff --git a/.circleci/config.yml b/.circleci/config.yml index fc7eb2d..3d466bc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,6 +20,9 @@ jobs: echo "Running Pkl unit tests" .\pkl test --junit-reports test-results\ --project-dir codegen\src\ + echo "Installing go-junit-report" + go install github.com/jstemmer/go-junit-report/v2@latest + echo "Running Go unit tests" go test -race -v .\... 2>&1 | go-junit-report -iocopy -set-exit-code -out test-results\go-test-results.xml name: go test From bea5e1ba3feaa1afebbb16147353a752b0fec9e7 Mon Sep 17 00:00:00 2001 From: Dan Chao Date: Thu, 20 Jun 2024 13:44:22 -0700 Subject: [PATCH 5/7] Adjustment --- .circleci/config.pkl | 22 +++++++++++++++++++++- .circleci/config.yml | 19 +++++++++++++++++-- 2 files changed, 38 insertions(+), 3 deletions(-) diff --git a/.circleci/config.pkl b/.circleci/config.pkl index daaa24c..35d73d2 100644 --- a/.circleci/config.pkl +++ b/.circleci/config.pkl @@ -94,6 +94,9 @@ jobs { new RunStep { name = "go test" shell = "powershell.exe" + environment { + ["CGO_ENABLED"] = "1" + } command = #""" echo "Installing Go" Invoke-WebRequest "https://go.dev/dl/go1.21.11.windows-386.msi" -OutFile go.exe @@ -126,18 +129,35 @@ jobs { ["GOOS"] = if (os == "linux" || os == "windows") os else "darwin" ["GOARCH"] = if (arch == "amd64") arch else "arm64" } + local ext = if (os == "windows") "exe" else "bin" command = #""" # strip preceding "v" VERSION="${CIRCLE_TAG:1}" go build \ - -o out/pkl-gen-go/pkl-gen-go-\#(os)-\#(arch).bin \ + -o out/pkl-gen-go/pkl-gen-go-\#(os)-\#(arch).\#(ext) \ -ldflags="-X 'main.Version=$VERSION'" \ cmd/pkl-gen-go/pkl-gen-go.go """# } } } + new RunStep { + name = "go build windows amd64" + environment { + ["GOOS"] = "windows" + ["GOARCH"] = "amd64" + } + command = #""" + # strip preceding "v" + VERSION="${CIRCLE_TAG:1}" + + go build \ + -o out/pkl-gen-go/pkl-gen-go-windows-amd64.exe \ + -ldflags="-X 'main.Version=$VERSION'" \ + cmd/pkl-gen-go/pkl-gen-go.go + """# + } new PersistToWorkspaceStep { root = "." paths { diff --git a/.circleci/config.yml b/.circleci/config.yml index 3d466bc..77f45f3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,6 +27,8 @@ jobs: go test -race -v .\... 2>&1 | go-junit-report -iocopy -set-exit-code -out test-results\go-test-results.xml name: go test shell: powershell.exe + environment: + CGO_ENABLED: '1' resource_class: windows.medium machine: image: windows-server-2022-gui:current @@ -91,7 +93,7 @@ jobs: VERSION="${CIRCLE_TAG:1}" go build \ - -o out/pkl-gen-go/pkl-gen-go-windows-amd64.bin \ + -o out/pkl-gen-go/pkl-gen-go-windows-amd64.exe \ -ldflags="-X 'main.Version=$VERSION'" \ cmd/pkl-gen-go/pkl-gen-go.go name: go build windows amd64 @@ -104,13 +106,26 @@ jobs: VERSION="${CIRCLE_TAG:1}" go build \ - -o out/pkl-gen-go/pkl-gen-go-windows-aarch64.bin \ + -o out/pkl-gen-go/pkl-gen-go-windows-aarch64.exe \ -ldflags="-X 'main.Version=$VERSION'" \ cmd/pkl-gen-go/pkl-gen-go.go name: go build windows aarch64 environment: GOOS: windows GOARCH: arm64 + - run: + command: |- + # strip preceding "v" + VERSION="${CIRCLE_TAG:1}" + + go build \ + -o out/pkl-gen-go/pkl-gen-go-windows-amd64.exe \ + -ldflags="-X 'main.Version=$VERSION'" \ + cmd/pkl-gen-go/pkl-gen-go.go + name: go build windows amd64 + environment: + GOOS: windows + GOARCH: amd64 - persist_to_workspace: root: '.' paths: From eb33c6ea87d6a9e9a327c23029c9d0c75b0e5cd7 Mon Sep 17 00:00:00 2001 From: Dan Chao Date: Thu, 20 Jun 2024 14:06:09 -0700 Subject: [PATCH 6/7] Adjustment --- .circleci/config.pkl | 5 +---- .circleci/config.yml | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.circleci/config.pkl b/.circleci/config.pkl index 35d73d2..77c4988 100644 --- a/.circleci/config.pkl +++ b/.circleci/config.pkl @@ -94,9 +94,6 @@ jobs { new RunStep { name = "go test" shell = "powershell.exe" - environment { - ["CGO_ENABLED"] = "1" - } command = #""" echo "Installing Go" Invoke-WebRequest "https://go.dev/dl/go1.21.11.windows-386.msi" -OutFile go.exe @@ -114,7 +111,7 @@ jobs { go install github.com/jstemmer/go-junit-report/v2@latest echo "Running Go unit tests" - go test -race -v .\... 2>&1 | go-junit-report -iocopy -set-exit-code -out test-results\go-test-results.xml + go test -v .\... 2>&1 | go-junit-report -iocopy -set-exit-code -out test-results\go-test-results.xml """# } } diff --git a/.circleci/config.yml b/.circleci/config.yml index 77f45f3..6ed1ca7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,11 +24,9 @@ jobs: go install github.com/jstemmer/go-junit-report/v2@latest echo "Running Go unit tests" - go test -race -v .\... 2>&1 | go-junit-report -iocopy -set-exit-code -out test-results\go-test-results.xml + go test -v .\... 2>&1 | go-junit-report -iocopy -set-exit-code -out test-results\go-test-results.xml name: go test shell: powershell.exe - environment: - CGO_ENABLED: '1' resource_class: windows.medium machine: image: windows-server-2022-gui:current From 9f901d9bc4de591aed6d2a79a204fe5b7e0aaa5c Mon Sep 17 00:00:00 2001 From: Dan Chao Date: Thu, 20 Jun 2024 14:06:50 -0700 Subject: [PATCH 7/7] Adjustment --- .circleci/config.pkl | 4 +++- .circleci/config.yml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.circleci/config.pkl b/.circleci/config.pkl index 77c4988..507a403 100644 --- a/.circleci/config.pkl +++ b/.circleci/config.pkl @@ -95,8 +95,10 @@ jobs { name = "go test" shell = "powershell.exe" command = #""" - echo "Installing Go" + echo "Downloading Go" Invoke-WebRequest "https://go.dev/dl/go1.21.11.windows-386.msi" -OutFile go.exe + + echo "Installing Go" $pkg = "$PWD\go.exe" Start-Process msiexec "/i $pkg /qn"; diff --git a/.circleci/config.yml b/.circleci/config.yml index 6ed1ca7..1391cb1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,8 +8,10 @@ jobs: - checkout - run: command: |- - echo "Installing Go" + echo "Downloading Go" Invoke-WebRequest "https://go.dev/dl/go1.21.11.windows-386.msi" -OutFile go.exe + + echo "Installing Go" $pkg = "$PWD\go.exe" Start-Process msiexec "/i $pkg /qn";