Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/cargo-lambda/devcontainer-feature.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
"type": "string",
"default": "latest",
"description": "Version of cargo lambda to install"
},
"binstall-version": {
"type": "string",
"default": "latest",
"description": "Version of cargo-binstall to install"
}
},
"dependsOn": {
Expand Down
7 changes: 5 additions & 2 deletions src/cargo-lambda/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ fi

dpkg -l | grep build-essential || (apt update && apt install build-essential -y -qq)


if ! cargo install --list | grep "cargo-binstall" > /dev/null; then
cargo install cargo-binstall
if [ -z "${BINSTALL_VERSION}" ] || [ "${BINSTALL_VERSION}" = "latest" ]; then
cargo install cargo-binstall
else
cargo install cargo-binstall --version ${BINSTALL_VERSION}
fi
fi

umask 002
Expand Down
9 changes: 9 additions & 0 deletions test/cargo-lambda/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,14 @@
"version": "1.6.0"
}
}
},
"versioned-binstall": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"cargo-lambda": {
"version": "1.6.0",
"binstall-version": "1.3.0"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ source dev-container-features-test-lib
# Feature-specific tests
# The 'check' command comes from the dev-container-features-test-lib.
# check <LABEL> <cmd> [args...]
check "cargo lambda installed with 1.6.0" bash -c "cargo lambda --version" | grep -oP '\d+\.\d+\.\d+'
check "cargo lambda installed with 1.6.0" bash -c "cargo lambda --version" | grep -oP '\d+\.\d+\.\d+' | grep 1.6.0
check "cargo binstall installed with 1.3.0" bash -c "cargo binstall --version" | grep -oP '\d+\.\d+\.\d+' | grep 1.3.0

# Report results
# If any of the checks above exited with a non-zero exit code, the test will fail.
Expand Down