mirror of
https://github.com/actions/setup-go.git
synced 2025-04-23 17:40:50 +00:00
Add e2e test
This commit is contained in:
parent
1c500a4414
commit
c5c2a053c1
1 changed files with 62 additions and 0 deletions
62
.github/workflows/windows-validation.yml
vendored
Normal file
62
.github/workflows/windows-validation.yml
vendored
Normal file
|
@ -0,0 +1,62 @@
|
||||||
|
name: Basic validation
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
create-link-on-windows:
|
||||||
|
runs-on: windows-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
cache: [false, true]
|
||||||
|
go: [1.20.1]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: ./
|
||||||
|
with:
|
||||||
|
go-version: ${{ matrix.go }}
|
||||||
|
cache: ${{ matrix.cache }}
|
||||||
|
name: v4-cache-${{ matrix.cache }}
|
||||||
|
|
||||||
|
- 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')
|
||||||
|
# make sure archive does not take lost of the space
|
||||||
|
if [ $size -gt 999 ];then
|
||||||
|
echo 'Size of installed on drive d: go is too big';
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
du -m -s 'C:\hostedtoolcache\windows\go\${{ matrix.go }}\x64'
|
||||||
|
# make sure drive c: contains only a link
|
||||||
|
size=$(du -m -s 'C:\hostedtoolcache\windows\go\${{ matrix.go }}\x64'|cut -f1 -d$'\t')
|
||||||
|
if [ $size -ne 0 ];then
|
||||||
|
echo 'Size of the link created on drive c: must be 0'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
name: Disk usage
|
||||||
|
|
||||||
|
- run: |
|
||||||
|
echo $PATH
|
||||||
|
which go
|
||||||
|
go version
|
||||||
|
go env
|
||||||
|
if [ $(which go) != '/c/hostedtoolcache/windows/go/${{ matrix.go }}/x64/bin/go' ];then
|
||||||
|
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"'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
shell: bash
|
||||||
|
name: test paths and environments
|
Loading…
Add table
Reference in a new issue