Skip to content

Commit

Permalink
Cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
zak-pawel committed Oct 23, 2023
1 parent c747f0b commit ce8272c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 17 deletions.
32 changes: 23 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,21 @@ commands:
condition:
equal: [ windows, << parameters.os >> ]
steps:
- run: rm -rf '/c/Program Files/Go'
- run: rm -rf '/c/ProgramData/chocolatey/lib/mingw'
- run:
name: Remove Go and MinGW to avoid clashes after upgrade during cache restore
command: |
rm -rf '/c/Program Files/Go'
rm -rf '/c/ProgramData/chocolatey/lib/mingw'
- when:
condition:
equal: [ darwin, << parameters.os >> ]
steps:
- run: rm -rf '/usr/local/Cellar/go'
- run: sudo mkdir -p '/usr/local/Cellar/go'
- run: sudo chown -R $(id -u):$(id -g) '/usr/local/Cellar/go'
- run:
name: Ensure go directory is empty and have proper permissions before cache restore
command: |
sudo rm -rf '/usr/local/Cellar/go'
sudo mkdir -p '/usr/local/Cellar/go'
sudo chown -R $(id -u):$(id -g) '/usr/local/Cellar/go'
- restore_cache:
name: "Restore binaries from cache"
key: go-bins-<< parameters.cache_version >>-<< parameters.os >>-<< parameters.arch >>-go<< parameters.goversion >>-{{ checksum "go.sum" }}
Expand Down Expand Up @@ -117,10 +123,18 @@ commands:
equal: [ "386", << parameters.arch >> ]
steps:
- run: echo 'export RACE="-race"' >> $BASH_ENV
- run: |
export PATH="/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin:$PATH"
echo "PATH: $PATH"
GOARCH=<< parameters.arch >> ./<< parameters.gotestsum >> -- ${RACE} -short -cover -coverprofile=coverage.out ./...
- when:
condition:
equal: [ windows, << parameters.os >> ]
steps:
- run: |
export PATH="/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin:$PATH"
GOARCH=<< parameters.arch >> ./<< parameters.gotestsum >> -- ${RACE} -short -cover -coverprofile=coverage.out ./...
- unless:
condition:
equal: [ windows, << parameters.os >> ]
steps:
- run: GOARCH=<< parameters.arch >> ./<< parameters.gotestsum >> -- ${RACE} -short -cover -coverprofile=coverage.out ./...
- when:
condition:
and:
Expand Down
2 changes: 1 addition & 1 deletion scripts/installgo_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ fi

echo "$PATH"
command -v go
go version
go version
1 change: 1 addition & 0 deletions scripts/installgo_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@ else
setup_go
fi

echo "$PATH"
command -v go
go version
1 change: 1 addition & 0 deletions scripts/installgo_windows.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ else
setup_go
fi

echo "$PATH"
command -v go
go version
11 changes: 4 additions & 7 deletions scripts/installmingw_windows.sh
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
#!/bin/sh

set -ux
set -eux

MINGW_VERSION="12.2.0.03042023"
GCC_VERSION="12.2.0"

setup_mingw () {
choco upgrade mingw --allow-downgrade --force --version=${MINGW_VERSION} --verbose --debug
choco upgrade mingw --allow-downgrade --force --version=${MINGW_VERSION}
}

export PATH="/c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin:$PATH"

echo "PATH: $PATH"
command -v gcc
gcc -dumpversion
echo "$PATH"

if command -v gcc >/dev/null 2>&1; then
echo "MinGW is already installed"
Expand All @@ -26,6 +23,6 @@ else
setup_mingw
fi

echo "PATH: $PATH"
echo "$PATH"
command -v gcc
gcc -dumpversion

0 comments on commit ce8272c

Please sign in to comment.