-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add binary integration testing support to GitHub Actions workflow #8693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
d97d22b
adds binary test for linux
roger-zhangg 10072ac
gh token
roger-zhangg a111720
test
roger-zhangg ab8f4bb
latest release
roger-zhangg 333aec5
nit
roger-zhangg e81ffa8
unset
roger-zhangg acf9a2d
nit
roger-zhangg b670151
nit
roger-zhangg fda5a41
nit
roger-zhangg 27f6a37
zig
roger-zhangg bf74ebc
Merge branch 'develop' into binary-test
roger-zhangg 5eb83c0
nit
roger-zhangg da12c7a
Merge branch 'binary-test' of github.com:roger-zhangg/aws-sam-cli int…
roger-zhangg 2a0e4d6
address feedback
roger-zhangg 5382d88
Merge branch 'develop' into binary-test
roger-zhangg 524573b
use release instead
roger-zhangg b382eff
Merge branch 'binary-test' of github.com:roger-zhangg/aws-sam-cli int…
roger-zhangg 78e24b4
upload different test type report to its own folder
roger-zhangg 6cfa2b4
move typical test sam cli into venv
roger-zhangg 17a7d63
still use system
roger-zhangg ccccfc3
nit
roger-zhangg 20c95c8
Merge branch 'develop' into binary-test
roger-zhangg a259bec
nit
roger-zhangg b006139
nit
roger-zhangg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| #!/bin/bash | ||
| # Install Rust toolchain and cargo-lambda for SAM CLI integration tests. | ||
| # Usage: ./tests/install-rust.sh [CARGO_LAMBDA_VERSION] | ||
| # CARGO_LAMBDA_VERSION defaults to env var or "v0.17.1" | ||
| set -euo pipefail | ||
|
|
||
| CARGO_LAMBDA_VERSION="${1:-${CARGO_LAMBDA_VERSION:-v0.17.1}}" | ||
|
|
||
| # Install rustup if not present | ||
| if ! command -v rustup &> /dev/null; then | ||
| curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL https://sh.rustup.rs | sh -s -- --default-toolchain none -y | ||
| source "$HOME/.cargo/env" | ||
| if [ -n "${GITHUB_PATH:-}" ]; then | ||
| echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> "$GITHUB_PATH" | ||
| fi | ||
| fi | ||
|
|
||
| rustup toolchain install stable --profile minimal --no-self-update | ||
| rustup default stable | ||
| rustup target add x86_64-unknown-linux-gnu --toolchain stable | ||
| rustup target add aarch64-unknown-linux-gnu --toolchain stable | ||
|
|
||
| # Install cargo-lambda and ziglang | ||
| python3.11 -m pip install "cargo-lambda==$CARGO_LAMBDA_VERSION" | ||
|
|
||
| # Create a zig wrapper so SAM CLI's cargo-lambda can find it | ||
| printf '#!/bin/bash\nexec python3.11 -m ziglang "$@"\n' | sudo tee /usr/local/bin/zig > /dev/null | ||
| sudo chmod +x /usr/local/bin/zig | ||
|
|
||
| rustc -V | ||
| cargo -V | ||
| zig version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| #!/bin/bash | ||
| # Install SAM CLI binary from a GitHub release, auto-detecting OS and architecture. | ||
| # Usage: ./test/install-sam-cli-binary.sh [<tag>] | ||
| # If <tag> is provided (e.g. sam-cli-nightly), downloads from that release. | ||
| # If omitted, downloads from the latest (non-pre-release) release. | ||
| set -euo pipefail | ||
|
|
||
| TAG="${1:-}" | ||
| OS="$(uname -s | tr '[:upper:]' '[:lower:]')" | ||
| ARCH="$(uname -m)" | ||
|
|
||
| # Map to asset naming convention | ||
| case "$OS" in | ||
| linux) | ||
| case "$ARCH" in | ||
| x86_64) ASSET="aws-sam-cli-linux-x86_64.zip" ;; | ||
| aarch64) ASSET="aws-sam-cli-linux-arm64.zip" ;; | ||
| *) echo "Unsupported Linux architecture: $ARCH"; exit 1 ;; | ||
| esac | ||
| ;; | ||
| darwin) | ||
| case "$ARCH" in | ||
| x86_64) ASSET="aws-sam-cli-macos-x86_64.pkg" ;; | ||
| arm64) ASSET="aws-sam-cli-macos-arm64.pkg" ;; | ||
| *) echo "Unsupported macOS architecture: $ARCH"; exit 1 ;; | ||
| esac | ||
| ;; | ||
| *) | ||
| echo "Unsupported OS: $OS"; exit 1 | ||
| ;; | ||
| esac | ||
|
|
||
| echo "Detected OS=$OS ARCH=$ARCH -> downloading $ASSET" | ||
|
|
||
| # Download to a temp directory and clean up on exit | ||
| TMPDIR="$(mktemp -d)" | ||
| trap 'rm -rf "$TMPDIR"' EXIT | ||
|
|
||
| if [ -n "$TAG" ]; then | ||
| gh release download "$TAG" --repo aws/aws-sam-cli --pattern "$ASSET" --clobber --dir "$TMPDIR" | ||
| else | ||
| gh release download --repo aws/aws-sam-cli --pattern "$ASSET" --clobber --dir "$TMPDIR" | ||
| fi | ||
|
|
||
| # Install | ||
| case "$ASSET" in | ||
| *.zip) | ||
| unzip -o "$TMPDIR/$ASSET" -d "$TMPDIR/sam-installation" | ||
| sudo "$TMPDIR/sam-installation/install" --update | ||
| ;; | ||
| *.pkg) | ||
| sudo installer -pkg "$TMPDIR/$ASSET" -target / | ||
| ;; | ||
| esac | ||
|
|
||
| # Nightly installs as sam-nightly; rename to sam | ||
| if [ -f /usr/local/bin/sam-nightly ]; then | ||
| sudo mv /usr/local/bin/sam-nightly /usr/local/bin/sam | ||
| fi | ||
|
|
||
| sam --version |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.