Skip to content

Commit 4f962f0

Browse files
committed
Merge branch 'develop' into fix-command-help-text
2 parents c9719be + c95e0ac commit 4f962f0

90 files changed

Lines changed: 938 additions & 895 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ jobs:
172172
ruby-version: "3.3"
173173
- uses: actions/setup-node@v6
174174
with:
175-
node-version: 22
175+
node-version: 24
176176
- uses: actions/setup-java@v5
177177
with:
178178
distribution: 'corretto'
@@ -186,18 +186,9 @@ jobs:
186186
with:
187187
dotnet-version: '10.0.x'
188188
# Install and configure Rust & Cargo Lambda
189-
- name: Install and configure Rust & Cargo Lambda
189+
- name: Install Rust toolchain and cargo-lambda
190190
if: ${{ matrix.os == 'ubuntu-latest' }}
191-
run: |
192-
: install rustup if needed
193-
if ! command -v rustup &> /dev/null ; then
194-
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
195-
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
196-
fi
197-
rustup toolchain install stable --profile minimal --no-self-update
198-
rustup default stable
199-
pip install "cargo-lambda==$CARGO_LAMBDA_VERSION"
200-
echo "$HOME/.local/bin" >> $GITHUB_PATH
191+
run: bash tests/install-rust.sh
201192
- name: Init samdev
202193
run: make init
203194
- name: uv install setuptools in Python3.12

.github/workflows/integration-tests.yml

Lines changed: 57 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,23 @@ on:
55
# Run at 7pm PST (3am UTC next day) Monday-Friday
66
# This translates to Tuesday-Saturday 3am UTC
77
- cron: '0 3 * * 2-6'
8+
release:
9+
types: [published, edited]
10+
# published → latest-release binary test (full releases only)
11+
# edited + prerelease → nightly binary test (nightly pre-release gets edited with new artifacts)
812
workflow_dispatch: # Allow manual triggering
913
# NOTE: This workflow can only be manually triggered from develop or main branches
1014
# The other branch will not pass the OIDC permission check
15+
inputs:
16+
install_mode:
17+
description: '"code" to install from source (make init), "nightly-release" to install SAM CLI nightly binary, "latest-release" to install latest stable release binary'
18+
required: false
19+
default: 'code'
20+
type: choice
21+
options:
22+
- code
23+
- nightly-release
24+
- latest-release
1125

1226
permissions:
1327
id-token: write # Required for OIDC
@@ -153,20 +167,9 @@ jobs:
153167
with:
154168
ruby-version: '3.4.7'
155169

156-
- name: Install Rust toolchain
170+
- name: Install Rust toolchain and cargo-lambda
157171
if: contains(fromJSON('["build-x86-1", "build-x86-2", "build-arm64", "cloud-based-tests", "tier1-finch"]'), matrix.test_suite)
158-
run: |
159-
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL https://sh.rustup.rs | sh -s -- --default-toolchain none -y
160-
source $HOME/.cargo/env
161-
rustup toolchain install stable --profile minimal --no-self-update
162-
rustup default stable
163-
rustup target add x86_64-unknown-linux-gnu --toolchain stable
164-
rustup target add aarch64-unknown-linux-gnu --toolchain stable
165-
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
166-
167-
- name: Install cargo-lambda
168-
if: contains(fromJSON('["build-x86-1", "build-x86-2", "build-arm64", "cloud-based-tests", "tier1-finch"]'), matrix.test_suite)
169-
run: pip install cargo-lambda==${{ env.CARGO_LAMBDA_VERSION }}
172+
run: bash tests/install-rust.sh
170173

171174
- name: Install Terraform
172175
if: contains(fromJSON('["terraform-build", "terraform-start-api", "terraform-invoke-start-lambda", "cloud-based-tests", "tier1-finch"]'), matrix.test_suite)
@@ -193,18 +196,52 @@ jobs:
193196
if: "!contains(fromJSON('[\"build-x86-1\", \"build-x86-2\", \"build-x86-container-1\", \"build-x86-container-2\", \"tier1-finch\"]'), matrix.test_suite)"
194197
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
195198

196-
- name: Initialize project
199+
- name: Determine test type
197200
run: |
198-
if [[ "${{ matrix.test_suite }}" == "tier1-finch" ]]; then
199-
export CONTAINER_RUNTIME=finch
201+
echo "CONTAINER_RUNTIME=${{ matrix.test_suite == 'tier1-finch' && 'finch' || 'docker' }}" >> $GITHUB_ENV
202+
if [[ "${{ inputs.install_mode }}" == "nightly-release" ]] || \
203+
[[ "${{ github.event.action }}" == "edited" && "${{ github.event.release.prerelease }}" == "true" ]]; then
204+
echo "TEST_TYPE=nightly-release" >> $GITHUB_ENV
205+
elif [[ "${{ inputs.install_mode }}" == "latest-release" ]] || \
206+
[[ "${{ github.event.action }}" == "published" && "${{ github.event.release.prerelease }}" != "true" ]]; then
207+
echo "TEST_TYPE=latest-release" >> $GITHUB_ENV
208+
elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
209+
echo "TEST_TYPE=master" >> $GITHUB_ENV
210+
elif [[ "${{ github.event_name }}" == "schedule" ]] || [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
211+
echo "TEST_TYPE=develop" >> $GITHUB_ENV
200212
else
201-
export CONTAINER_RUNTIME=docker
213+
echo "TEST_TYPE=other" >> $GITHUB_ENV
202214
fi
215+
216+
- name: Initialize integration test
217+
if: env.TEST_TYPE == 'develop' || env.TEST_TYPE == 'master' || env.TEST_TYPE == 'other'
218+
run: |
203219
make init
220+
echo "SCRIPT_PY=python3.11" >> $GITHUB_ENV
221+
222+
- name: Initialize nightly release test
223+
if: env.TEST_TYPE == 'nightly-release'
224+
env:
225+
GH_TOKEN: ${{ github.token }}
226+
run: |
227+
make setup-pytest
228+
make init-nightly
229+
echo "SAM_CLI_DEV=" >> $GITHUB_ENV
230+
echo "SCRIPT_PY=$HOME/pytest/bin/python3" >> $GITHUB_ENV
231+
232+
- name: Initialize latest release test
233+
if: env.TEST_TYPE == 'latest-release'
234+
env:
235+
GH_TOKEN: ${{ github.token }}
236+
run: |
237+
make setup-pytest
238+
make init-latest-release
239+
echo "SAM_CLI_DEV=" >> $GITHUB_ENV
240+
echo "SCRIPT_PY=$HOME/pytest/bin/python3" >> $GITHUB_ENV
204241
205242
- name: Get testing resources and credentials
206243
if: "!contains(fromJSON('[\"build-x86-1\", \"build-x86-2\", \"build-arm64\", \"build-x86-container-1\", \"build-x86-container-2\", \"build-arm64-container-1\", \"build-arm64-container-2\", \"local-invoke\", \"local-start-api\", \"local-start-lambda\"]'), matrix.test_suite)"
207-
run: python3.11 tests/setup_testing_resources.py
244+
run: $SCRIPT_PY tests/setup_testing_resources.py
208245

209246
- name: Login to Public ECR
210247
run: |
@@ -374,7 +411,7 @@ jobs:
374411
375412
- name: Upload test results
376413
if: always()
377-
uses: actions/upload-artifact@v6
414+
uses: actions/upload-artifact@v7
378415
with:
379416
name: test-results-${{ matrix.test_suite }}
380417
path: TEST_REPORT-*.json
@@ -398,4 +435,4 @@ jobs:
398435
if: always()
399436
env:
400437
TESTREPORTING_S3: ${{ secrets.TESTREPORTING_S3 }}
401-
run: python3.11 tests/reset_testing_resources.py ${{ matrix.test_suite }}
438+
run: $SCRIPT_PY tests/reset_testing_resources.py ${{ matrix.test_suite }}

.github/workflows/validate_pyinstaller.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
sudo ./sam-installation/install
3333
sam-beta --version
3434
./tests/sanity-check.sh
35-
- uses: actions/upload-artifact@v6
35+
- uses: actions/upload-artifact@v7
3636
with:
3737
name: pyinstaller-linux-zip
3838
path: .build/output/aws-sam-cli-linux-x86_64.zip
@@ -61,7 +61,7 @@ jobs:
6161
sudo ./sam-installation/install
6262
sam-beta --version
6363
./tests/sanity-check.sh
64-
- uses: actions/upload-artifact@v6
64+
- uses: actions/upload-artifact@v7
6565
with:
6666
name: pyinstaller-macos-zip
6767
path: .build/output/aws-sam-cli-macos-x86_64.zip

Makefile

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# environment variable.
33
SAM_CLI_TELEMETRY ?= 0
44

5-
.PHONY: schema
5+
.PHONY: schema init-nightly init-latest-release setup-pytest
66

77
# Initialize environment specifically for Github action tests using uv
88
init:
@@ -13,6 +13,21 @@ init:
1313
SAM_CLI_DEV=1 pip install -e '.[dev]'; \
1414
fi
1515

16+
# Set up a pytest venv with test dependencies
17+
setup-pytest:
18+
python3.11 -m venv $(HOME)/pytest
19+
uv pip install --python $(HOME)/pytest/bin/python3 -r requirements/dev.txt -r requirements/base.txt
20+
sudo ln -sf $(HOME)/pytest/bin/pytest /usr/local/bin/pytest
21+
pytest --version
22+
23+
# Install SAM CLI nightly binary
24+
init-nightly:
25+
bash tests/install-sam-cli-binary.sh sam-cli-nightly
26+
27+
# Install SAM CLI latest release binary
28+
init-latest-release:
29+
bash tests/install-sam-cli-binary.sh
30+
1631
test:
1732
# Run unit tests and fail if coverage falls below 94%
1833
pytest --cov samcli --cov schema --cov-report term-missing --cov-fail-under 94 tests/unit
@@ -52,7 +67,11 @@ black:
5267
black setup.py samcli tests schema
5368

5469
black-check:
55-
black --check setup.py samcli tests schema
70+
@if python -c "import sys; sys.exit(0 if sys.version_info >= (3, 10) else 1)" 2>/dev/null; then \
71+
black --check setup.py samcli tests schema; \
72+
else \
73+
echo "Skipping black check on Python < 3.10"; \
74+
fi
5675

5776
format: black
5877
ruff check samcli --fix

requirements/base.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
chevron~=0.12
22
click==8.1.8
33
Flask<3.2
4-
boto3[crt]==1.42.26
5-
jmespath~=1.0.1
4+
boto3[crt]==1.42.58
5+
jmespath~=1.1.0
66
ruamel_yaml~=0.19.1
77
PyYAML~=6.0
88
cookiecutter~=2.6.0
99
aws-sam-translator==1.107.0
1010
#docker minor version updates can include breaking changes. Auto update micro version only.
1111
docker~=7.1.0
12-
dateparser~=1.2
12+
dateparser~=1.3; python_version>="3.10"
13+
dateparser~=1.2; python_version<"3.10"
1314
requests~=2.32.5
1415
aws_lambda_builders==1.62.0
1516
tomlkit==0.14.0
1617
# NOTE: For supporting watchdog in Python3.8, version is pinned to 4.0.2 as
1718
# version 5.0.2 introduced some breaking changes for versions > Python3.8
1819
watchdog==4.0.2
1920

20-
rich~=14.2.0
21+
rich~=14.3.3
2122
pyopenssl~=25.3.0
2223
# Pin to <4.18 to until SAM-T no longer uses RefResolver
2324
jsonschema<4.27
@@ -31,7 +32,7 @@ regex!=2021.10.8
3132
tzlocal==5.3.1
3233

3334
#Adding cfn-lint dependency for SAM validate
34-
cfn-lint~=1.43.1
35+
cfn-lint~=1.45.0
3536

3637
# Type checking boto3 objects
3738
boto3-stubs[apigateway,cloudformation,ecr,iam,lambda,s3,schemas,secretsmanager,signer,stepfunctions,sts,xray,sqs,kinesis]>=1.41.0

requirements/dev.txt

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-r pre-dev.txt
22

3-
coverage==7.10.7; python_version>="3.9"
4-
coverage==7.6.1; python_version<"3.9"
3+
coverage==7.13.4; python_version>="3.10"
4+
coverage==7.10.7; python_version<"3.10"
55
pytest-cov==7.0.0; python_version>="3.9"
66
pytest-cov==5.0.0; python_version<"3.9"
77

@@ -15,11 +15,14 @@ types-pywin32==308.0.0.20241221; python_version<"3.9"
1515
types-PyYAML==6.0.12.20250915
1616
types-chevron==0.14.2.20250103
1717
types-psutil==7.2.2.20260130
18-
types-setuptools==80.10.0.20260124
18+
types-setuptools==82.0.0.20260210; python_version>="3.10"
19+
types-setuptools==80.10.0.20260124; python_version<"3.10"
1920
types-Pygments==2.19.0.20251121
2021
types-colorama==0.4.15.20250801
21-
types-dateparser==1.2.2.20250809
22-
types-docutils==0.22.3.20251115
22+
types-dateparser==1.3.0.20260211; python_version>="3.10"
23+
types-dateparser==1.2.2.20250809; python_version<"3.10"
24+
types-docutils==0.22.3.20260223; python_version>="3.10"
25+
types-docutils==0.22.3.20251115; python_version<"3.10"
2326
types-jsonschema==4.26.0.20260202
2427
types-pyOpenSSL==24.1.0.20240722
2528
# lucashuy: pin `types-request` based on the Python version since newer versions of
@@ -30,7 +33,8 @@ types-urllib3==1.26.25.14
3033

3134
# Test requirements
3235

33-
pytest==8.4.1
36+
pytest==9.0.2; python_version>="3.10"
37+
pytest==8.4.1; python_version<"3.10"
3438

3539
parameterized==0.9.0
3640
pytest-xdist==3.8.0
@@ -46,9 +50,9 @@ filelock==3.24.3; python_version>="3.10"
4650
filelock==3.19.1; python_version<"3.10"
4751

4852
# formatter
49-
black==25.9.0; python_version>="3.9"
50-
black==24.8.0; python_version<"3.9"
51-
psutil==7.2.1
53+
black==26.1.0; python_version>"3.9"
54+
black==25.9.0; python_version<="3.9"
55+
psutil==7.2.2
5256

5357
# Pin chardet to avoid requests compatibility assertion failure (requests requires chardet < 6)
5458
chardet<6

requirements/pre-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ruff==0.14.14
1+
ruff==0.15.4

requirements/pyinstaller-build.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Executable binary builder requirements
2-
setuptools==80.9.0
2+
setuptools==82.0.0
33
pyinstaller==6.19.0

0 commit comments

Comments
 (0)