Skip to content

Commit c450bf1

Browse files
authored
fix: install sam cli conditionally
1 parent 775495f commit c450bf1

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

.github/workflows/test-build.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ jobs:
2626

2727
- name: Install AWS SAM CLI
2828
run: |
29-
cd /tmp
30-
wget https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip
31-
unzip aws-sam-cli-linux-x86_64.zip -d aws-sam-cli-linux-x86_64
32-
sudo ./aws-sam-cli-linux-x86_64/install
33-
sam --version
29+
if [ ! $(command -v sam) ]; then
30+
cd /tmp
31+
wget https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip
32+
unzip aws-sam-cli-linux-x86_64.zip -d aws-sam-cli-linux-x86_64 -q
33+
sudo ./aws-sam-cli-linux-x86_64/install
34+
sam --version
35+
fi
3436
3537
- name: Test deploy.sh script
3638
run: ./deploy.sh
@@ -62,7 +64,7 @@ jobs:
6264
run: |
6365
cd /tmp
6466
wget https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip
65-
unzip aws-sam-cli-linux-x86_64.zip -d aws-sam-cli-linux-x86_64
67+
unzip aws-sam-cli-linux-x86_64.zip -d aws-sam-cli-linux-x86_64 -q
6668
sudo ./aws-sam-cli-linux-x86_64/install
6769
sam --version
6870

0 commit comments

Comments
 (0)