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
1226permissions :
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 }}
0 commit comments