From 519f66e17803bc0df99c6b1736d4c1b64dbba242 Mon Sep 17 00:00:00 2001 From: Luqi Pan Date: Tue, 20 Aug 2024 11:57:24 -0700 Subject: [PATCH 1/5] ci(integration): add a step to archive core proposal artifacts --- .github/workflows/integration.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index aa0f206be32..15ff2278880 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -271,6 +271,11 @@ jobs: - name: build proposals tests run: yarn build working-directory: a3p-integration + - name: Archive core proposals + uses: actions/upload-artifact@v4 + with: + name: core-proposals + path: a3p-integration/**/submission - name: run proposals tests run: yarn test working-directory: a3p-integration From 9ee1c9485506a49654a8b25d4c721eb35121a2ce Mon Sep 17 00:00:00 2001 From: Luqi Pan Date: Tue, 20 Aug 2024 15:10:08 -0700 Subject: [PATCH 2/5] ci(integration): add a script to zip up core proposals and remove colon --- .github/workflows/integration.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 15ff2278880..e644f6808c9 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -271,11 +271,24 @@ jobs: - name: build proposals tests run: yarn build working-directory: a3p-integration - - name: Archive core proposals + - name: zip up all core proposals + run: | + find . -type d -path "./a3p-integration/proposals/*/submission" | while read -r dir; do + parent_dir=$(basename "$(dirname "$dir")") + + sanitized_parent_dir=${parent_dir//:/-} + + zip_file="${sanitized_parent_dir}.zip" + + zip -r "$zip_file" "$dir" + + echo "Zipped $dir into $zip_file" + done + - name: archive core proposals uses: actions/upload-artifact@v4 with: name: core-proposals - path: a3p-integration/**/submission + path: ./*.zip - name: run proposals tests run: yarn test working-directory: a3p-integration From 3b9b28fc92f76d8fc7ff62a1cc24474134daff5d Mon Sep 17 00:00:00 2001 From: Luqi Pan Date: Wed, 21 Aug 2024 10:09:36 -0700 Subject: [PATCH 3/5] ci(integration): remove all zip files after they're archived --- .github/workflows/integration.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index e644f6808c9..0e6a4761183 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -289,6 +289,8 @@ jobs: with: name: core-proposals path: ./*.zip + - name: remove all zip files after they're archived + run: rm -f *.zip - name: run proposals tests run: yarn test working-directory: a3p-integration From c012f95837a15a1b11a00f730678e3481646b75e Mon Sep 17 00:00:00 2001 From: Luqi Pan Date: Wed, 21 Aug 2024 14:01:36 -0700 Subject: [PATCH 4/5] ci(integration): incorporate code review feedbacks - collect core proposals after proposals tests - collect core proposals under /tmp/core_proposals - add comments on how to find the archived core proposals --- .github/workflows/integration.yml | 32 +++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 0e6a4761183..8f1a807b4f1 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -271,29 +271,33 @@ jobs: - name: build proposals tests run: yarn build working-directory: a3p-integration - - name: zip up all core proposals + - name: run proposals tests + run: yarn test + working-directory: a3p-integration + - name: collect all core proposals + # Core proposals will be copied under /tmp/core_proposals directory + # colons in the parent directory name will be replaced with dashes run: | find . -type d -path "./a3p-integration/proposals/*/submission" | while read -r dir; do + # Get the parent directory name parent_dir=$(basename "$(dirname "$dir")") - + # Replace colons with dashes in the parent directory name sanitized_parent_dir=${parent_dir//:/-} - - zip_file="${sanitized_parent_dir}.zip" - - zip -r "$zip_file" "$dir" - - echo "Zipped $dir into $zip_file" + # Create the destination directory under /tmp/core_proposals if it doesn't exist + destination_dir="/tmp/core_proposals/$sanitized_parent_dir" + mkdir -p "$destination_dir" + # Copy everything from the $dir to the destination directory + cp -r "$dir"/* "$destination_dir/" + echo "Copied contents of $dir to $destination_dir" done - name: archive core proposals + # This zip file can be found at the bottom of `Summary` page of + # `Integration tests` workflow once the workflow is completed. + # Ref: https://github.com/actions/upload-artifact?tab=readme-ov-file#where-does-the-upload-go uses: actions/upload-artifact@v4 with: name: core-proposals - path: ./*.zip - - name: remove all zip files after they're archived - run: rm -f *.zip - - name: run proposals tests - run: yarn test - working-directory: a3p-integration + path: /tmp/core_proposals - name: notify on failure if: failure() && github.event_name != 'pull_request' uses: ./.github/actions/notify-status From dc9a73e17230f07bd2e1649210a555cd946ab66f Mon Sep 17 00:00:00 2001 From: Luqi Pan Date: Wed, 21 Aug 2024 15:18:35 -0700 Subject: [PATCH 5/5] ci(integration): refer to artifacts as core eval scripts as that is more accurate --- .github/workflows/integration.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 8f1a807b4f1..51c231f665b 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -274,8 +274,8 @@ jobs: - name: run proposals tests run: yarn test working-directory: a3p-integration - - name: collect all core proposals - # Core proposals will be copied under /tmp/core_proposals directory + - name: collect all core eval scripts + # Core eval scripts will be copied under /tmp/core_eval_scripts directory # colons in the parent directory name will be replaced with dashes run: | find . -type d -path "./a3p-integration/proposals/*/submission" | while read -r dir; do @@ -283,21 +283,21 @@ jobs: parent_dir=$(basename "$(dirname "$dir")") # Replace colons with dashes in the parent directory name sanitized_parent_dir=${parent_dir//:/-} - # Create the destination directory under /tmp/core_proposals if it doesn't exist - destination_dir="/tmp/core_proposals/$sanitized_parent_dir" + # Create the destination directory under /tmp/core_eval_scripts if it doesn't exist + destination_dir="/tmp/core_eval_scripts/$sanitized_parent_dir" mkdir -p "$destination_dir" # Copy everything from the $dir to the destination directory cp -r "$dir"/* "$destination_dir/" echo "Copied contents of $dir to $destination_dir" done - - name: archive core proposals - # This zip file can be found at the bottom of `Summary` page of + - name: archive core eval scripts + # The core eval scripts can be found at the bottom of `Summary` page of # `Integration tests` workflow once the workflow is completed. # Ref: https://github.com/actions/upload-artifact?tab=readme-ov-file#where-does-the-upload-go uses: actions/upload-artifact@v4 with: - name: core-proposals - path: /tmp/core_proposals + name: core-eval-scripts + path: /tmp/core_eval_scripts - name: notify on failure if: failure() && github.event_name != 'pull_request' uses: ./.github/actions/notify-status