Skip to content

Commit 5d3f2e0

Browse files
authored
chore: Adding retries to CI (#857)
Adding retries and using grade task for caching and etc.
1 parent c630cc1 commit 5d3f2e0

File tree

5 files changed

+61
-36
lines changed

5 files changed

+61
-36
lines changed

.github/actions/install_smithy_dafny_codegen_dependencies/action.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,18 @@ runs:
1414
distribution: "corretto"
1515
java-version: "17"
1616

17-
- name: Install smithy-dafny-codegen dependencies locally
18-
shell: bash
19-
run: |
20-
make -C mpl/smithy-dafny mvn_local_deploy_polymorph_dependencies
17+
- name: Setup Gradle
18+
uses: gradle/actions/setup-gradle@v4
19+
20+
- name: Install smithy-dafny-codegen dependencies locally (with retry)
21+
uses: nick-fields/retry@v3
22+
with:
23+
timeout_minutes: 15
24+
max_attempts: 3
25+
retry_on: error
26+
shell: bash
27+
command: |
28+
make -C mpl/smithy-dafny mvn_local_deploy_polymorph_dependencies
2129
2230
- name: Setup Python, black, and docformatter for code formatting
2331
uses: actions/setup-python@v6
@@ -41,7 +49,12 @@ runs:
4149
go install golang.org/x/tools/cmd/goimports@v0.36.0
4250
4351
# Without this the if-dafny-at-least command includes "Downloading ..." output
44-
- name: Arbitrary makefile target to force downloading Gradle
45-
shell: bash
46-
run: |
47-
make -C mpl/StandardLibrary setup_net
52+
- name: Arbitrary makefile target to force downloading Gradle (with retry)
53+
uses: nick-fields/retry@v3
54+
with:
55+
timeout_minutes: 10
56+
max_attempts: 3
57+
retry_on: error
58+
shell: bash
59+
command: |
60+
make -C mpl/StandardLibrary setup_net

.github/workflows/dafny_interop_test_vector_net.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ jobs:
232232
zip -qq net41.zip -r .
233233
234234
- name: Upload Zip File
235-
uses: actions/upload-artifact@v4
235+
uses: actions/upload-artifact@v6
236236
if: matrix.os != 'windows-latest'
237237
with:
238238
name: ${{matrix.os}}_mpl-${{inputs.mpl-dafny}}_esdk-${{inputs.esdk-dafny}}_vectors

.github/workflows/library_interop_keyring_test_vectors.yml

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -83,31 +83,43 @@ jobs:
8383
path: ./${{ matrix.library }}/aws-encryption-sdk-c/aws-sdk-cpp
8484
submodules: recursive
8585

86-
- name: Build and install aws-sdk-cpp
86+
- name: Build and install aws-sdk-cpp (with retry)
8787
if: matrix.language == 'c' && matrix.os != 'ubuntu-22.04'
88-
working-directory: ./${{ matrix.library }}/aws-encryption-sdk-c
89-
run: |
90-
# remove the following line once aws-sdk-cpp fixes linux-shared/SimpleUDP.cpp
91-
perl -i -p -e 's/"-Werror"//' aws-sdk-cpp/cmake/compiler_settings.cmake
92-
mkdir -p aws-encryption-sdk-c/build-aws-sdk-cpp || true
93-
mkdir -p install || true
94-
cd build-aws-sdk-cpp
95-
cmake -G Xcode -DTARGET_ARCH="APPLE" -DBUILD_SHARED_LIBS=ON -DBUILD_ONLY="kms" -DENABLE_UNITY_BUILD=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/TestVectors/aws-encryption-sdk-c/install -DCMAKE_PREFIX_PATH=${{github.workspace}}/TestVectors/aws-encryption-sdk-c/install ../aws-sdk-cpp
96-
xcodebuild -target ALL_BUILD
97-
xcodebuild -target install
98-
99-
- name: Build and install aws-sdk-cpp
88+
uses: nick-fields/retry@v3
89+
with:
90+
timeout_minutes: 30
91+
max_attempts: 3
92+
retry_on: error
93+
shell: bash
94+
command: |
95+
cd ./${{ matrix.library }}/aws-encryption-sdk-c
96+
# remove the following line once aws-sdk-cpp fixes linux-shared/SimpleUDP.cpp
97+
perl -i -p -e 's/"-Werror"//' aws-sdk-cpp/cmake/compiler_settings.cmake
98+
mkdir -p aws-encryption-sdk-c/build-aws-sdk-cpp || true
99+
mkdir -p install || true
100+
cd build-aws-sdk-cpp
101+
cmake -G Xcode -DTARGET_ARCH="APPLE" -DBUILD_SHARED_LIBS=ON -DBUILD_ONLY="kms" -DENABLE_UNITY_BUILD=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/TestVectors/aws-encryption-sdk-c/install -DCMAKE_PREFIX_PATH=${{github.workspace}}/TestVectors/aws-encryption-sdk-c/install ../aws-sdk-cpp
102+
xcodebuild -target ALL_BUILD
103+
xcodebuild -target install
104+
105+
- name: Build and install aws-sdk-cpp (with retry)
100106
if: matrix.os == 'ubuntu-22.04' && matrix.language == 'c'
101-
working-directory: ./${{ matrix.library }}/aws-encryption-sdk-c
102-
run: |
103-
# remove the following line once aws-sdk-cpp fixes linux-shared/SimpleUDP.cpp
104-
perl -i -p -e 's/"-Werror"//' aws-sdk-cpp/cmake/compiler_settings.cmake
105-
mkdir -p build-aws-sdk-cpp || true
106-
mkdir -p install || true
107-
cd build-aws-sdk-cpp
108-
cmake -DBUILD_SHARED_LIBS=ON -DBUILD_ONLY="kms" -DENABLE_UNITY_BUILD=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/TestVectors/aws-encryption-sdk-c/install -DCMAKE_PREFIX_PATH=${{github.workspace}}/TestVectors/aws-encryption-sdk-c/install ../aws-sdk-cpp
109-
make
110-
make install
107+
uses: nick-fields/retry@v3
108+
with:
109+
timeout_minutes: 30
110+
max_attempts: 3
111+
retry_on: error
112+
shell: bash
113+
command: |
114+
cd ./${{ matrix.library }}/aws-encryption-sdk-c
115+
# remove the following line once aws-sdk-cpp fixes linux-shared/SimpleUDP.cpp
116+
perl -i -p -e 's/"-Werror"//' aws-sdk-cpp/cmake/compiler_settings.cmake
117+
mkdir -p build-aws-sdk-cpp || true
118+
mkdir -p install || true
119+
cd build-aws-sdk-cpp
120+
cmake -DBUILD_SHARED_LIBS=ON -DBUILD_ONLY="kms" -DENABLE_UNITY_BUILD=ON -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/TestVectors/aws-encryption-sdk-c/install -DCMAKE_PREFIX_PATH=${{github.workspace}}/TestVectors/aws-encryption-sdk-c/install ../aws-sdk-cpp
121+
make
122+
make install
111123
112124
- name: Build C-ESDK
113125
if: matrix.language == 'c' && matrix.os != 'ubuntu-22.04'
@@ -285,7 +297,7 @@ jobs:
285297
run: make test_encrypt_vectors_c_unix
286298

287299
- name: Upload Keyring Encrypt Manifest and keys.json files
288-
uses: actions/upload-artifact@v4
300+
uses: actions/upload-artifact@v6
289301
with:
290302
name: ${{matrix.os}}_vector_artifact_${{matrix.language}}_${{github.sha}}
291303
path: |

.github/workflows/library_interop_mkp_test_vectors.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ jobs:
212212
make test_encrypt_vectors_${{ matrix.language }}_legacy_format
213213
214214
- name: Upload Encrypt Manifest and keys.json files
215-
uses: actions/upload-artifact@v4
215+
uses: actions/upload-artifact@v6
216216
with:
217217
name: ${{matrix.os}}_vector_artifact_${{matrix.language}}_legacy_format_${{github.sha}}
218218
path: |
@@ -638,7 +638,7 @@ jobs:
638638
npx -y @aws-crypto/integration-node encrypt -m encrypt-manifest.json -k keys.json -d decrypt-manifest-js.zip -C
639639
640640
- name: Upload Encrypt Manifest and keys.json files
641-
uses: actions/upload-artifact@v4
641+
uses: actions/upload-artifact@v6
642642
with:
643643
name: ${{matrix.os}}_vector_artifact_javascript_legacy_format_${{github.sha}}
644644
path: |

.github/workflows/library_interop_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ jobs:
215215
zip -qq net41.zip -r .
216216
217217
- name: Upload Zip File
218-
uses: actions/upload-artifact@v4
218+
uses: actions/upload-artifact@v6
219219
if: matrix.os != 'windows-latest'
220220
with:
221221
name: ${{matrix.os}}_vector_artifact

0 commit comments

Comments
 (0)