Skip to content

Commit

Permalink
update sanity-check to use python runtime app template based on avail… (
Browse files Browse the repository at this point in the history
#6844)

* update sanity-check to use python runtime app template based on available python version

* update sanity-check to accept explicit init runtime
  • Loading branch information
hawflau authored Mar 15, 2024
1 parent ca11915 commit e1a5778
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/validate_pyinstaller.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ jobs:
# due to glibc requirement from github actions
# see example failure: https://github.com/aws/aws-sam-cli/actions/runs/6102715182/job/16561754862?pr=5887
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.20"
- name: Build PyInstaller
run: |
chmod +x ./installer/pyinstaller/build-linux.sh
Expand Down Expand Up @@ -52,15 +48,13 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.8"
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.20"
- name: Build PyInstaller
run: |
chmod +x ./installer/pyinstaller/build-mac.sh
./installer/pyinstaller/build-mac.sh aws-sam-cli-macos-x86_64.zip
- name: Basic tests for PyInstaller
env:
SAM_INIT_RUNTIME: "python3.8"
run: |
unzip .build/output/aws-sam-cli-macos-x86_64.zip -d sam-installation
sudo ./sam-installation/install
Expand Down
7 changes: 6 additions & 1 deletion tests/sanity-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
set -xeo pipefail

export SAM_CLI_TELEMETRY="${SAM_CLI_TELEMETRY:-0}"
export SAM_INIT_ARCH="${SAM_INIT_ARCH:-x86_64}"
export SAM_INIT_RUNTIME="${SAM_INIT_RUNTIME:-python3.11}"
export SAM_INIT_DEPENDENCY_MANAGER="${SAM_INIT_DEPENDENCY_MANAGER:-pip}"
export SAM_INIT_APP_TEMPLATE="${SAM_INIT_APP_TEMPLATE:-hello-world}"
export SAM_INIT_PACKAGE_TYPE="${SAM_INIT_PACKAGE_TYPE:-Zip}"

if [ "$CI_OVERRIDE" = "1" ]; then
sam_binary="sam-beta"
Expand Down Expand Up @@ -37,7 +42,7 @@ fi

echo "Starting testing sam binary"
rm -rf sam-app-testing
"$sam_binary" init --no-interactive -n sam-app-testing --dependency-manager mod --runtime go1.x --app-template hello-world --package-type Zip --architecture x86_64
"$sam_binary" init --no-interactive -n sam-app-testing --dependency-manager "$SAM_INIT_DEPENDENCY_MANAGER" --runtime "$SAM_INIT_RUNTIME" --app-template "$SAM_INIT_APP_TEMPLATE" --package-type "$SAM_INIT_PACKAGE_TYPE" --architecture "$SAM_INIT_ARCH"
cd sam-app-testing
GOFLAGS="-buildvcs=false" "$sam_binary" build
"$sam_binary" validate
Expand Down

0 comments on commit e1a5778

Please sign in to comment.