Skip to content

Commit e7b59f6

Browse files
committed
fix rust
1 parent 42ddfe5 commit e7b59f6

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

.github/workflows/integration-tests.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ env:
3131
jobs:
3232
integration-tests:
3333
# Only run scheduled jobs on the main aws/aws-sam-cli repository, not on forks
34-
if: github.event_name != 'schedule' || github.repository == 'aws/aws-sam-cli-skip'
34+
# if: github.event_name != 'schedule' || github.repository == 'aws/aws-sam-cli'
35+
if: github.repository == 'aws/aws-sam-cli-skip'
3536
name: ${{ matrix.test_suite }} (${{ matrix.container_runtime }})
3637
runs-on: ubuntu-22.04
3738
strategy:
@@ -663,13 +664,22 @@ jobs:
663664
if: contains(fromJSON('["build-integ", "build-integ-java-python-provided", "build-integ-arm64"]'), matrix.test_suite) && matrix.container_runtime == 'no-container'
664665
shell: bash
665666
run: |
666-
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL https://sh.rustup.rs | sh -s -- --default-toolchain none -y
667-
source "$HOME/.cargo/env"
667+
# On Windows runners, Rust is pre-installed; just ensure toolchain is configured
668+
if command -v rustup &> /dev/null; then
669+
echo "rustup already available, updating toolchain..."
670+
else
671+
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL https://sh.rustup.rs | sh -s -- --default-toolchain none -y
672+
# Source cargo env only on non-Windows (file doesn't exist on Windows)
673+
if [ -f "$HOME/.cargo/env" ]; then
674+
source "$HOME/.cargo/env"
675+
fi
676+
fi
668677
rustup toolchain install stable --profile minimal --no-self-update
669678
rustup default stable
670-
rustup target add x86_64-unknown-linux-gnu --toolchain stable
671-
rustup target add aarch64-unknown-linux-gnu --toolchain stable
672-
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
679+
# Add cross-compilation targets (may not all be available on Windows but won't fail)
680+
rustup target add x86_64-unknown-linux-gnu --toolchain stable || true
681+
rustup target add aarch64-unknown-linux-gnu --toolchain stable || true
682+
echo "$USERPROFILE\\.cargo\\bin" >> $GITHUB_PATH || echo "$HOME/.cargo/bin" >> $GITHUB_PATH
673683
674684
- name: Install cargo-lambda
675685
if: contains(fromJSON('["build-integ", "build-integ-java-python-provided", "build-integ-arm64"]'), matrix.test_suite) && matrix.container_runtime == 'no-container'

0 commit comments

Comments
 (0)