fix: tip now require go1.22.6 to compile #129
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Check | |
run: | | |
perl -V | |
perl -c install-go.pl | |
- name: Environment | |
run: | | |
env | sort | |
- name: Test GOROOT version | |
run: | | |
version=$(echo "$GOROOT" | perl -nE '/(\d+.\d+.\d+)/ and say $1') | |
if [ -n "$version" ]; then | |
mkdir xxx | |
./install-go.pl -p -e $version xxx | |
./xxx/go/bin/go version | tee xxx/go-version | |
fgrep -q go$version xxx/go-version | |
if [ -s "$GITHUB_PATH" ]; then | |
echo "*** GITHUB_PATH file altered:" | |
cat $GITHUB_PATH | |
echo "--------------------" | |
false | |
fi | |
if [ -s "$GITHUB_ENV" ]; then | |
echo "*** GITHUB_ENV file altered:" | |
cat $GITHUB_ENV | |
echo "--------------------" | |
false | |
fi | |
chmod -R u+w xxx | |
rm -rf xxx | |
elif [ -z "$GOROOT" ]; then | |
echo "GOROOT not available in environment" | |
else | |
echo "*** Cannot find go version in GOROOT value: <$GOROOT>" | |
false | |
fi | |
- name: Test old version | |
run: | | |
mkdir xxx | |
./install-go.pl 1.15.1 xxx | |
if [ ! -s "$GITHUB_PATH" ]; then | |
echo "*** GITHUB_PATH file is empty" | |
false | |
fi | |
if [ ! -s "$GITHUB_ENV" ]; then | |
echo "*** GITHUB_ENV file is empty" | |
false | |
fi | |
- name: Test just set PATH, GOROOT and GOPATH | |
run: | | |
env | sort | |
go version | |
go version | fgrep -q go1.15.1 | |
if [ -z "$GOROOT" ]; then | |
echo "*** GOROOT is empty" | |
false | |
fi | |
if ! echo "$GOPATH" | egrep -q 'xxx/go/gopath$'; then | |
echo "*** GOPATH incorrectly set: '$GOPATH'" | |
false | |
fi | |
chmod -R u+w xxx | |
rm -rf xxx | |
- name: Test GOROOT_X_Y_X64 version with -p | |
run: | | |
version=$(env | perl -nE '/^GOROOT_\d+_\d+_X64=.*(\d+.\d+.\d+)/ and say $1 and exit 0') | |
if [ -z "$version" ]; then | |
echo "No GOROOT_X_Y_X64 found" | |
exit 0 | |
fi | |
mkdir xxx | |
./install-go.pl -p $version xxx | |
./xxx/go/bin/go version | tee xxx/go-version | |
fgrep -q go$version xxx/go-version | |
if [ -s "$GITHUB_PATH" ]; then | |
echo "*** GITHUB_PATH file altered:" | |
cat $GITHUB_PATH | |
echo "--------------------" | |
false | |
fi | |
if [ ! -s "$GITHUB_ENV" ]; then | |
echo "*** GITHUB_ENV file is empty" | |
false | |
fi | |
chmod -R u+w xxx | |
rm -rf xxx | |
- name: Test old version with --dont-alter-github-path --dont-alter-github-env | |
run: | | |
mkdir xxx | |
./install-go.pl --dont-alter-github-path --dont-alter-github-env 1.15.x xxx | |
./xxx/go/bin/go version | tee xxx/go-version | |
fgrep -q go1.15. xxx/go-version | |
if [ -s "$GITHUB_PATH" ]; then | |
echo "*** GITHUB_PATH file altered:" | |
cat $GITHUB_PATH | |
echo "--------------------" | |
false | |
fi | |
if [ -s "$GITHUB_ENV" ]; then | |
echo "*** GITHUB_ENV file altered:" | |
cat $GITHUB_ENV | |
echo "--------------------" | |
false | |
fi | |
true | |
- name: Test already built tip | |
run: | | |
echo "GOROOT=$GOROOT" > GITHUB_PATH.prev | |
echo "GOPATH=$GOPATH" >> GITHUB_PATH.prev | |
mkdir zzz | |
./install-go.pl tip zzz | |
./zzz/go/bin/go version | tee zzz/go-version | |
fgrep -q 'go version devel' zzz/go-version | |
if [ ! -s "$GITHUB_PATH" ]; then | |
echo "*** GITHUB_PATH file is empty" | |
false | |
fi | |
if [ ! -s "$GITHUB_ENV" ]; then | |
echo "*** GITHUB_ENV file is empty" | |
false | |
fi | |
chmod -R u+w zzz | |
rm -rf zzz | |
mv GITHUB_PATH.prev "$GITHUB_ENV" | |
- name: Test building tip | |
run: | | |
mkdir zzz | |
ALWAYS_BUILD_TIP=1 ./install-go.pl tip zzz | |
./zzz/go/bin/go version | tee zzz/go-version | |
fgrep -q 'go version devel' zzz/go-version | |
if [ ! -s "$GITHUB_PATH" ]; then | |
echo "*** GITHUB_PATH file is empty" | |
false | |
fi | |
if [ ! -s "$GITHUB_ENV" ]; then | |
echo "*** GITHUB_ENV file is empty" | |
false | |
fi | |
chmod -R u+w zzz xxx | |
rm -rf zzz xxx |