diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 4ae7458e4d38..2be6ba6790ed 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -229,6 +229,14 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: + - name: update job environment + run: | + if [ ":$HOME" = : ]; then + # Keep the first two path components, e.g. /home/runner. + HOME="(pwd | sed -E 's#^(/[^/]+/[^/]+).*#\1#')" + echo "HOME=$HOME" >> "$GITHUB_ENV" + fi + echo "SLOGFILE=$HOME/test.slog" >> "$GITHUB_ENV" - name: free up disk space run: | # Workaround to provide additional free space for testing. @@ -279,30 +287,57 @@ jobs: - name: run proposals tests run: yarn test working-directory: a3p-integration - - 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 + - name: copy a3p-integration + if: (success() || failure()) 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//:/-} - # 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" + # Copy everything from a3p-integration to /tmp/export/a3p-integration + # except `node_modules` and `.yarn`, replacing colons in proposal + # directory names with dashes. + EXPORT_DIR='/tmp/export' + rm -rf "$EXPORT_DIR/a3p-integration" + # Because of the exclusions, copying applies to disjoint subtrees of a3p-integration: + # * children except `agoric-sdk` and `proposals` + # * file children of `proposals`, i.e. `proposals/*` + # * grandchildren of `proposals`, i.e. `proposals/*/*` + # + # We accomplish this by consuming (subdir?, depth, `find` filter?) tuples. + SUBSEP="$(printf '\034')" + printf " $SUBSEP 1 $SUBSEP -not -name agoric-sdk -not -name proposals + proposals $SUBSEP 1 $SUBSEP -type f + proposals $SUBSEP 2 + " \ + | sed -E 's/^ *|#.*//g; /^[[:space:]]*$/d;' \ + | while IFS="$SUBSEP" read subdir depth filter; do + find a3p-integration/$subdir -mindepth ${depth:-1} -maxdepth ${depth:-1} \ + -name node_modules -prune -o -name .yarn -prune -o $filter -print \ + | while read -r path; do + dirname="$(dirname -- "$path")" + dest="$EXPORT_DIR/$dirname" # $dirname already starts with a3p-integration + sanitized="${dest//:/-}" + mkdir -p "$sanitized" + cp -r -- "$path" "$sanitized/" + echo "Copied $dirname to $sanitized" + done \ + | uniq done - - 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 + # Artifacts 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 + - name: archive a3p-integration + if: (success() || failure()) + uses: actions/upload-artifact@v4 + with: + name: a3p-integration + path: /tmp/export/a3p-integration + - name: archive slogfile + if: (success() || failure()) uses: actions/upload-artifact@v4 with: - name: core-eval-scripts - path: /tmp/core_eval_scripts + name: slogfile + path: ${{ env.SLOGFILE }} + # To help with debugging, retain slogfiles for 4 days after success + # or 10 days after failure. + retention-days: ${{ success() && 4 || 10 }} - name: notify on failure if: failure() && github.event_name != 'pull_request' uses: ./.github/actions/notify-status diff --git a/a3p-integration/package.json b/a3p-integration/package.json index c0aac139b141..ad61ebdafb43 100644 --- a/a3p-integration/package.json +++ b/a3p-integration/package.json @@ -13,7 +13,7 @@ "doctor": "yarn synthetic-chain doctor" }, "dependencies": { - "@agoric/synthetic-chain": "^0.3.0", + "@agoric/synthetic-chain": "^0.4.0", "@types/better-sqlite3": "^7.6.11" }, "packageManager": "yarn@4.5.1",