mirror of
https://github.com/actions/setup-go.git
synced 2025-06-30 05:03:43 +00:00
test hosted version of go
This commit is contained in:
parent
96a955403c
commit
60dde965e0
3 changed files with 27 additions and 9 deletions
27
.github/workflows/windows-validation.yml
vendored
27
.github/workflows/windows-validation.yml
vendored
|
@ -1,4 +1,4 @@
|
|||
name: Basic validation
|
||||
name: validate Windows installation
|
||||
|
||||
on:
|
||||
push:
|
||||
|
@ -16,7 +16,8 @@ jobs:
|
|||
strategy:
|
||||
matrix:
|
||||
cache: [false, true]
|
||||
go: [1.20.1]
|
||||
go: [1.20.1, 1.20.5]
|
||||
name: 'Setup ${{ matrix.go }} cache: ${{ matrix.cache }}'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
|
@ -26,6 +27,23 @@ jobs:
|
|||
cache: ${{ matrix.cache }}
|
||||
name: v4-cache-${{ matrix.cache }}
|
||||
|
||||
- run: |
|
||||
if [ -e 'D:\hostedtoolcache\windows\go\${{ matrix.go }}\x64' ];then
|
||||
echo 'D:\hostedtoolcache\windows\go\${{ matrix.go }}\x64 should not exist for hosted version of go';
|
||||
exit 1
|
||||
fi
|
||||
|
||||
du -m -s 'C:\hostedtoolcache\windows\go\${{ matrix.go }}\x64'
|
||||
# make sure drive c: contains the folder
|
||||
size=$(du -m -s 'C:\hostedtoolcache\windows\go\${{ matrix.go }}\x64'|cut -f1 -d$'\t')
|
||||
if [ $size -eq 0 ];then
|
||||
echo 'Size of the hosted go installed on drive c: must be above zero'
|
||||
exit 1
|
||||
fi
|
||||
shell: bash
|
||||
name: Hosted go should not have link
|
||||
if: ${{ matrix.go == '1.20.5' }}
|
||||
|
||||
- run: |
|
||||
du -m -s 'D:\hostedtoolcache\windows\go\${{ matrix.go }}\x64'
|
||||
size=$(du -m -s 'D:\hostedtoolcache\windows\go\${{ matrix.go }}\x64'|cut -f1 -d$'\t')
|
||||
|
@ -44,6 +62,7 @@ jobs:
|
|||
fi
|
||||
shell: bash
|
||||
name: Disk usage
|
||||
if: ${{ matrix.go != '1.20.5' }}
|
||||
|
||||
- run: |
|
||||
echo $PATH
|
||||
|
@ -54,8 +73,8 @@ jobs:
|
|||
echo 'which go should return "/c/hostedtoolcache/windows/go/${{ matrix.go }}/x64/bin/go"'
|
||||
exit 1
|
||||
fi
|
||||
if [ $(go env GOROOT) != 'C:\hostedtoolcache\windows\go\1.20.1\x64' ];then
|
||||
echo 'go env GOROOT should return "C:\hostedtoolcache\windows\go\1.20.1\x64"'
|
||||
if [ $(go env GOROOT) != 'C:\hostedtoolcache\windows\go\${{ matrix.go }}\x64' ];then
|
||||
echo 'go env GOROOT should return "C:\hostedtoolcache\windows\go\${{ matrix.go }}\x64"'
|
||||
exit 1
|
||||
fi
|
||||
shell: bash
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue