forked from aws/aws-sam-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
214 lines (181 loc) · 6.9 KB
/
appveyor.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
version: 1.0.{build}
image:
- Ubuntu
- Visual Studio 2019
environment:
AWS_DEFAULT_REGION: us-east-1
SAM_CLI_DEV: 1
matrix:
- PYTHON_HOME: "C:\\Python36-x64"
PYTHON_VERSION: '3.6'
PYTHON_ARCH: '64'
NOSE_PARAMETERIZED_NO_WARN: 1
INSTALL_PY_37_PIP: 1
INSTALL_PY_38_PIP: 1
INSTALL_PY_39_PIP: 1
AWS_S3: 'AWS_S3_36'
AWS_ECR: 'AWS_ECR_36'
APPVEYOR_CONSOLE_DISABLE_PTY: true
- PYTHON_HOME: "C:\\Python37-x64"
PYTHON_VERSION: '3.7'
PYTHON_ARCH: '64'
RUN_SMOKE: 1
NOSE_PARAMETERIZED_NO_WARN: 1
INSTALL_PY_36_PIP: 1
INSTALL_PY_38_PIP: 1
INSTALL_PY_39_PIP: 1
AWS_S3: 'AWS_S3_37'
AWS_ECR: 'AWS_ECR_37'
APPVEYOR_CONSOLE_DISABLE_PTY: true
- PYTHON_HOME: "C:\\Python38-x64"
PYTHON_VERSION: '3.8'
PYTHON_ARCH: '64'
RUN_SMOKE: 1
NOSE_PARAMETERIZED_NO_WARN: 1
INSTALL_PY_36_PIP: 1
INSTALL_PY_37_PIP: 1
INSTALL_PY_39_PIP: 1
AWS_S3: 'AWS_S3_38'
AWS_ECR: 'AWS_ECR_38'
APPVEYOR_CONSOLE_DISABLE_PTY: true
- PYTHON_HOME: "C:\\Python39-x64"
PYTHON_VERSION: '3.9'
PYTHON_ARCH: '64'
RUN_SMOKE: 1
NOSE_PARAMETERIZED_NO_WARN: 1
INSTALL_PY_36_PIP: 1
INSTALL_PY_37_PIP: 1
INSTALL_PY_38_PIP: 1
AWS_S3: 'AWS_S3_39'
AWS_ECR: 'AWS_ECR_39'
APPVEYOR_CONSOLE_DISABLE_PTY: true
for:
-
matrix:
only:
- image: Visual Studio 2019
install:
- "SET PATH=%PYTHON_HOME%;%PATH%"
- "echo %PYTHON_HOME%"
- "echo %PATH%"
- "python --version"
# Upgrade setuptools, wheel and virtualenv
- "SET PATH=%PYTHON_HOME%;%PATH%"
- "echo %PYTHON_HOME%"
- "echo %PATH%"
- "python -m pip install --upgrade setuptools wheel virtualenv"
- "docker info"
# Install AWS CLI Globally outside of a venv.
- "pip install awscli"
# Create pre-dev virtual env without installing dev depenencies
# This is used for import check for prod code to prevent importing packages from dev.txt
- "rm -rf pre-dev-venv"
- "python -m virtualenv pre-dev-venv"
- "pre-dev-venv\\Scripts\\activate"
- "python --version"
- "deactivate"
# Create dev virtual env
- "rm -rf venv"
- "python -m virtualenv venv"
- "venv\\Scripts\\activate"
- "python --version"
- "deactivate"
build_script:
# Install pre-dev dependencies
# This env is currently used for doing import check with Pylint without dev.txt dependencies installed
- "pre-dev-venv\\Scripts\\activate"
- "python -c \"import sys; print(sys.executable)\""
- "pip install -e \".[pre-dev]\""
- "deactivate"
# Install dev dependencies
- "venv\\Scripts\\activate"
- "python -c \"import sys; print(sys.executable)\""
- "pip install -e \".[dev]\""
- "deactivate"
test_script:
# Run pylint on pre-dev env to catch import errors
- "pre-dev-venv\\Scripts\\activate"
- "pylint --rcfile .pylintrc samcli"
- "deactivate"
# Run tests with dev env
- "venv\\Scripts\\activate"
- "pytest --cov samcli --cov-report term-missing --cov-fail-under 94 tests/unit"
- "pylint --rcfile .pylintrc samcli"
- "mypy setup.py samcli tests"
- "pytest -n 4 tests/functional"
- "deactivate"
-
matrix:
only:
- image: Ubuntu
install:
# apt repo for python3.9 installation
- sh: "sudo add-apt-repository ppa:deadsnakes/ppa"
# AppVeyor's apt-get cache might be outdated, and the package could potentially be 404.
- sh: "sudo apt-get update"
- sh: "gvm use go1.13"
- sh: "echo $PATH"
- sh: "ls /usr/"
- sh: "JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64"
- sh: "PATH=$JAVA_HOME/bin:$PATH"
- sh: "source ${HOME}/venv${PYTHON_VERSION}/bin/activate"
- sh: "rvm use 2.7.2"
- sh: "docker --version"
# Install latest gradle
- sh: "sudo apt-get -y remove gradle"
- sh: "wget https://services.gradle.org/distributions/gradle-5.5-bin.zip -P /tmp"
- sh: "sudo unzip -d /opt/gradle /tmp/gradle-*.zip"
- sh: "PATH=/opt/gradle/gradle-5.5/bin:$PATH"
# Install AWS CLI
- sh: "virtualenv aws_cli"
- sh: "./aws_cli/bin/python -m pip install awscli"
- sh: "PATH=$(echo $PWD'/aws_cli/bin'):$PATH"
- sh: "sudo apt-get -y install python3.6"
- sh: "sudo apt-get -y install python2.7"
- sh: "sudo apt-get -y install python3.7"
- sh: "sudo apt-get -y install python3.8"
- sh: "sudo apt-get -y install python3.9"
- sh: "which python3.8"
- sh: "which python3.7"
- sh: "which python3.6"
- sh: "which python3.9"
- sh: "which python2.7"
- sh: "PATH=$PATH:/usr/bin/python3.9:/usr/bin/python3.8:/usr/bin/python3.7"
- sh: "curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py"
- sh: "curl https://bootstrap.pypa.io/pip/3.6/get-pip.py -o get-pip-36.py"
- sh: "sudo apt-get -y install python3-distutils"
- sh: "sudo apt-get -y install python3.9-distutils"
- ps: "If ($env:INSTALL_PY_39_PIP) {python3.9 get-pip.py --user}"
- ps: "If ($env:INSTALL_PY_38_PIP) {python3.8 get-pip.py --user}"
- ps: "If ($env:INSTALL_PY_37_PIP) {python3.7 get-pip.py --user}"
- ps: "If ($env:INSTALL_PY_36_PIP) {python3.6 get-pip-36.py --user}"
# required for RIE with arm64 in linux
- sh: "docker run --rm --privileged multiarch/qemu-user-static --reset -p yes"
# update ca-certificates which causes failures with newest golang library
- sh: "sudo apt-get install --reinstall ca-certificates"
build_script:
- "python -c \"import sys; print(sys.executable)\""
test_script:
# Pre-dev Tests
- "pip install -e \".[pre-dev]\""
- "pylint --rcfile .pylintrc samcli"
# Dev Tests
- "pip install -e \".[dev]\""
- "pytest --cov samcli --cov-report term-missing --cov-fail-under 94 tests/unit"
- "pylint --rcfile .pylintrc samcli"
- "mypy setup.py samcli tests"
- "pytest -n 4 tests/functional"
# Runs only in Linux, logging Public ECR when running canary and cred is available
- sh: "
if [[ -n $BY_CANARY ]];
then echo Logging in Public ECR; aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws;
fi"
- sh: "pytest -vv tests/integration"
- sh: "pytest -vv tests/regression"
- sh: "black --check setup.py tests samcli"
# Set JAVA_HOME to java11
- sh: "JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64"
- sh: "pytest -vv tests/integration/buildcmd/test_build_cmd.py -k test_building_java11_in_process"
# Smoke tests run in parallel - it runs on both Linux & Windows
# Presence of the RUN_SMOKE envvar will run the smoke tests
- ps: "If ($env:RUN_SMOKE) {pytest -n 4 -vv tests/smoke}"