From 86b3553dadef39d1b163b84902185a7ba359bd38 Mon Sep 17 00:00:00 2001 From: Philip O'Toole Date: Tue, 12 Aug 2025 15:46:48 -0400 Subject: [PATCH] Factor out commands for Windows --- .circleci/config.yml | 62 +++++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 38 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 13ea1b98..92e314bd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -43,6 +43,28 @@ commands: # a reusable command with parameters GOOS: <> CC: <> + windows_setup_and_cache: + steps: + - checkout + - restore_cache: + keys: + - go-mod-v4-{{ checksum "go.sum" }} + - run: + name: Install Go and MinGW + command: | + choco install -y golang mingw + refreshenv + - run: + name: Add toolchains to PATH + command: | + $env:PATH += ";C:\Program Files\Go\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin" + go version + gcc --version + - run: + name: Fetch modules + command: | + go get -v -t -d ./... + jobs: lint: docker: @@ -178,25 +200,7 @@ jobs: shell: powershell.exe size: large steps: - - checkout - - restore_cache: - keys: - - go-mod-v4-{{ checksum "go.sum" }} - - run: - name: Install Go and MinGW - command: | - choco install -y golang mingw - refreshenv - - run: - name: Add toolchains to PATH - command: | - $env:PATH += ";C:\Program Files\Go\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin" - go version - gcc --version - - run: - name: Fetch modules - command: | - go get -v -t -d ./... + - windows_setup_and_cache - run: name: Test even packages command: | @@ -217,25 +221,7 @@ jobs: shell: powershell.exe size: large steps: - - checkout - - restore_cache: - keys: - - go-mod-v4-{{ checksum "go.sum" }} - - run: - name: Install Go and MinGW - command: | - choco install -y golang mingw - refreshenv - - run: - name: Add toolchains to PATH - command: | - $env:PATH += ";C:\Program Files\Go\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin" - go version - gcc --version - - run: - name: Fetch modules - command: | - go get -v -t -d ./... + - windows_setup_and_cache - run: name: Test odd packages command: |