generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 27
135 lines (121 loc) · 3.76 KB
/
test.yml
File metadata and controls
135 lines (121 loc) · 3.76 KB
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
name: "Tests"
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
jobs:
unit:
name: npm test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v5
- run: npm ci
- run: npm test
native-installer:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- ubuntu-22.04
- ubuntu-24.04-arm
name: Native installer / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Test official installer (pinned version)
uses: ./
with:
use-installer: true
version: "1.104.0"
- run: sam --version | grep -F 1.104.0
- name: Test official installer (pinned version; should use cache)
uses: ./
with:
use-installer: true
version: "1.104.0"
- run: sam --version | grep -F 1.104.0
- name: Test official installer (latest version)
uses: ./
with:
use-installer: true
- run: |
version=$(curl https://pypi.org/pypi/aws-sam-cli/json | jq -r .info.version)
sam --version | grep -F "$version"
shell: bash
integ:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
- ubuntu-22.04
- ubuntu-24.04-arm
python:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
name: PyPI / ${{ matrix.os }} / ${{ matrix.python }}
runs-on: ${{ matrix.os }}
env:
# Set SAM versions based on Python version
SAM_VERSION: ${{ contains(fromJson('["3.12", "3.13"]'), matrix.python) && '1.128.0' || '1.18.2' }}
INSTALLER_VERSION: ${{ contains( matrix.os, '-arm') && '1.130.0' || '1.71.0' }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Test official installer (pinned version)
if: startsWith(matrix.os, 'ubuntu')
uses: ./
with:
use-installer: true
version: ${{ env.INSTALLER_VERSION }}
- if: startsWith(matrix.os, 'ubuntu')
run: sam --version | grep -F ${{ env.INSTALLER_VERSION }}
- name: Test official installer (latest version)
if: startsWith(matrix.os, 'ubuntu')
uses: ./
with:
use-installer: true
- if: startsWith(matrix.os, 'ubuntu')
run: |
version=$(curl https://pypi.org/pypi/aws-sam-cli/json | jq -r .info.version)
sam --version | grep -F "$version"
shell: bash
# Test setup specific version
- uses: ./
with:
version: ${{ env.SAM_VERSION }}
- run: sam --version | grep -F ${{ env.SAM_VERSION }}
# Test setup latest version
- uses: ./
- run: |
version=$(curl https://pypi.org/pypi/aws-sam-cli/json | jq -r .info.version)
sam --version | grep -F "$version"
shell: bash
# Test sam init
- run: sam init --name sam-app --runtime nodejs20.x --dependency-manager npm --app-template hello-world
# Test sam build
- uses: actions/setup-node@v5
with:
node-version: "20"
- run: sam build
working-directory: ./sam-app
# Test sam build --use-container
# Doesn't work as-is on macOS or Windows due to licensing:
# - https://github.com/actions/runner-images/issues/17
# - https://github.com/actions/runner-images/issues/1143
# Ubuntu ARM runners are not yet GA
- if: startsWith(matrix.os, 'ubuntu') && !contains(matrix.os, '-arm')
run: sam build --use-container
working-directory: ./sam-app