forked from aws/aws-sam-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor-windows-build-go.yml
84 lines (68 loc) · 2.74 KB
/
appveyor-windows-build-go.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
version: 1.0.{build}
image: Windows Server 2019
build: off
# Change the clone folder to somewhere in "D:\" because this is shared by default with Docker. We need this to mount folders.
clone_folder: D:\source
environment:
AWS_DEFAULT_REGION: us-east-1
SAM_CLI_DEV: 1
APPVEYOR_CI_OVERRIDE: 1
# In Windows, tempdir is usually in C:\. But in AppVeyor only D:\ is shared in Docker.
# Therefore change TEMPDIR it to D: for invoke tests to work. Python uses $TMPDIR envvar
# to find root of tempdir
TMPDIR: D:\tmp
TEMP: D:\tmp
TMP: D:\tmp
# MSI Installers only use Py3.7.6. It is sufficient to test with this version here.
PYTHON_HOME: "C:\\Python37-x64"
PYTHON_SCRIPTS: "C:\\Python37-x64\\Scripts"
PYTHON_EXE: "C:\\Python37-x64\\python.exe"
PYTHON_ARCH: '64'
HOME: 'C:\Users\appveyor'
HOMEDRIVE: 'C:'
HOMEPATH: 'C:\Users\appveyor'
APPVEYOR_CONSOLE_DISABLE_PTY: true
init:
# Uncomment this for RDP
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
- ps: gcim Win32_Processor | % { "$($_.NumberOfLogicalProcessors) logical CPUs" }
- ps: gcim Win32_OperatingSystem | % { "$([int]($_.TotalVisibleMemorySize/1mb)) Gb" }
install:
# Install Go
- "choco install golang"
- "choco install bzr"
- "refreshenv"
- "go version"
- "go env"
# Set Go to allow modify go.mod and go.sum
# Breaking change introduced by https://golang.org/doc/go1.16
- "go env -w GOFLAGS=-mod=mod"
# Check that GOFLAGS have been set.
- "go env"
# Make sure the temp directory exists for Python to use.
- ps: "mkdir -Force D:\\tmp"
- "SET PATH=%PYTHON_HOME%;%PATH%"
- "echo %PYTHON_HOME%"
- "echo %PATH%"
- "python --version"
# Upgrade setuptools, wheel and virtualenv
- "python -m pip install --upgrade setuptools wheel virtualenv"
# Create new virtual environment with chosen python version and activate it
- "python -m virtualenv venv"
- "venv\\Scripts\\activate"
- "python --version"
# Actually install SAM CLI's dependencies
- "pip install -e \".[dev]\""
# Switch to Docker Linux containers
- ps: Switch-DockerLinux
# Echo final Path
- "echo %PATH%"
test_script:
# Reactivate virtualenv before running tests
- "venv\\Scripts\\activate"
- "docker system prune -a -f"
- "pytest -vv tests/integration/buildcmd/test_build_cmd.py -k TestBuildCommand_Go_Modules"
- "pytest -vv tests/integration/buildcmd/test_build_cmd.py -k TestBuildCommand_Go_Modules_With_Specified_Architecture"
# Uncomment for RDP
# on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))