From e884d166b1492887dfd25535bbf647e9ccc7584e Mon Sep 17 00:00:00 2001 From: soloseng <102702451+soloseng@users.noreply.github.com> Date: Tue, 13 Jun 2023 13:14:59 -0400 Subject: [PATCH 1/6] added submodules to protocol test matrix --- .github/workflows/circleci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/circleci.yml b/.github/workflows/circleci.yml index a0acc1eee91..4f2334081a0 100644 --- a/.github/workflows/circleci.yml +++ b/.github/workflows/circleci.yml @@ -335,6 +335,7 @@ jobs: uses: ./.github/actions/sync-workspace with: package-json-checksum: ${{ needs.install-dependencies.outputs.package-json-checksum }} + submodules: recursive - name: Build protocol run: | yarn --cwd packages/protocol build From a0299cd09245d092dd7e87dce49a4de70c6b7cc4 Mon Sep 17 00:00:00 2001 From: soloseng <102702451+soloseng@users.noreply.github.com> Date: Tue, 13 Jun 2023 13:16:58 -0400 Subject: [PATCH 2/6] format --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bc6cba82d3b..e3408fcefa7 100644 --- a/package.json +++ b/package.json @@ -133,4 +133,4 @@ "websocket-extensions": "^0.1.4", "y18n": "^5.0.5" } -} \ No newline at end of file +} From 65856ff3c93cf4ea070f86dcb6ab033e3c238f8c Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Tue, 13 Jun 2023 22:33:35 +0200 Subject: [PATCH 3/6] git submodule checkout in protocol jobs --- .github/workflows/circleci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/circleci.yml b/.github/workflows/circleci.yml index 4f2334081a0..1aa4648b9b6 100644 --- a/.github/workflows/circleci.yml +++ b/.github/workflows/circleci.yml @@ -331,11 +331,12 @@ jobs: path: .git key: git-${{ github.ref }} - uses: actions/checkout@v3 + with: + submodules: recursive - name: Sync workspace uses: ./.github/actions/sync-workspace with: package-json-checksum: ${{ needs.install-dependencies.outputs.package-json-checksum }} - submodules: recursive - name: Build protocol run: | yarn --cwd packages/protocol build From 3bbd1c102d66963efe8498d47dbd7de056ecbdea Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Wed, 14 Jun 2023 00:23:46 +0200 Subject: [PATCH 4/6] Fix protocol cache --- .github/actions/sync-workspace/action.yml | 19 ++++++++++++++++--- .github/workflows/circleci.yml | 9 +++++---- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/actions/sync-workspace/action.yml b/.github/actions/sync-workspace/action.yml index 3a67d1a1ef1..db756601448 100644 --- a/.github/actions/sync-workspace/action.yml +++ b/.github/actions/sync-workspace/action.yml @@ -4,21 +4,29 @@ inputs: package-json-checksum: description: "Checksum of package.json" required: true + rebuild-package: + description: "Rebuild package. It also disable fail-on-cache-miss" + required: false + default: 'false' runs: using: "composite" steps: - uses: actions/cache/restore@v3 id: cache_node + env: + REBUILD_PACKAGE: ${{ inputs.rebuild-package }} with: path: | node_modules packages/**/node_modules key: node-${{ runner.os }}-${{ runner.arch }}-${{ env.NODE_MODULE_CACHE_VERSION }}-${{ hashFiles('**/yarn.lock') }}-${{ inputs.package-json-checksum }} enableCrossOsArchive: true - fail-on-cache-miss: true + fail-on-cache-miss: "!${{ fromJSON(env.REBUILD_PACKAGE) }} && true" - name: Restore build artifacts cache - uses: actions/cache@v3 + uses: actions/cache/restore@v3 id: cache_build_artifacts + env: + REBUILD_PACKAGE: ${{ inputs.rebuild-package }} with: # We need to cache all the artifacts generated by yarn install+build # Update this list also in .github/actions/sync-workspace/action.yml with exactly the same list @@ -35,4 +43,9 @@ runs: restore-keys: | code-${{ github.sha }} enableCrossOsArchive: true - fail-on-cache-miss: true + fail-on-cache-miss: "!${{ fromJSON(env.REBUILD_PACKAGE) }} && true" + - name: Rebuild package + shell: bash --login -eo pipefail {0} + run: | + yarn install + yarn build --ignore docs --include-dependencies diff --git a/.github/workflows/circleci.yml b/.github/workflows/circleci.yml index 1aa4648b9b6..f060e1fc964 100644 --- a/.github/workflows/circleci.yml +++ b/.github/workflows/circleci.yml @@ -69,8 +69,9 @@ jobs: id: node-checksums run: | find . -maxdepth 5 -type f -name 'package.json' -not -path "*node_modules*" -print0 | sort -z | xargs -0 cat > $RUNNER_TEMP/package.checksum - find ./patches -type f -name '*.patch' -print0 | sort -z | xargs -0 cat > $RUNNER_TEMP/patches.checksum - echo "PACKAGE_JSON_CHECKSUM=${{ hashFiles('$RUNNER_TEMP/*.checksum') }}" >> "$GITHUB_OUTPUT" + find ./patches -type f -name '*.patch' -print0 | sort -z | xargs -0 cat >> $RUNNER_TEMP/package.checksum + echo "PACKAGE_JSON_CHECKSUM=$(md5sum $RUNNER_TEMP/package.checksum | cut -f1 -d' ')" + echo "PACKAGE_JSON_CHECKSUM=$(md5sum $RUNNER_TEMP/package.checksum | cut -f1 -d' ')" >> "$GITHUB_OUTPUT" - name: Restore node cache uses: actions/cache@v3 id: cache_node @@ -337,6 +338,7 @@ jobs: uses: ./.github/actions/sync-workspace with: package-json-checksum: ${{ needs.install-dependencies.outputs.package-json-checksum }} + rebuild-package: 'true' - name: Build protocol run: | yarn --cwd packages/protocol build @@ -755,7 +757,7 @@ jobs: - name: Setup tmate session uses: mxschmitt/action-tmate@v3 timeout-minutes: 20 - if: contains(matrix.command, '/lockedgold.sh') + if: contains(matrix.command, '/lockedgold.sh') && false with: limit-access-to-actor: true - name: Certora dependencies @@ -770,4 +772,3 @@ jobs: - name: Build and run command run: | ${{ matrix.command }} - \ No newline at end of file From 288f2c9eab505e3725dadce415f9b7868b22a5cb Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Wed, 14 Jun 2023 00:25:01 +0200 Subject: [PATCH 5/6] Rebuild protocol package --- .github/actions/sync-workspace/action.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/actions/sync-workspace/action.yml b/.github/actions/sync-workspace/action.yml index db756601448..2b918d1c155 100644 --- a/.github/actions/sync-workspace/action.yml +++ b/.github/actions/sync-workspace/action.yml @@ -46,6 +46,9 @@ runs: fail-on-cache-miss: "!${{ fromJSON(env.REBUILD_PACKAGE) }} && true" - name: Rebuild package shell: bash --login -eo pipefail {0} + env: + REBUILD_PACKAGE: ${{ inputs.rebuild-package }} + if: ${{ fromJSON(env.REBUILD_PACKAGE) }} run: | yarn install yarn build --ignore docs --include-dependencies From 336a5842766057795ae3cc447cfeb5ca7de24b72 Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Wed, 14 Jun 2023 00:27:18 +0200 Subject: [PATCH 6/6] Minnor change --- .github/actions/sync-workspace/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/sync-workspace/action.yml b/.github/actions/sync-workspace/action.yml index 2b918d1c155..3a45e77ef57 100644 --- a/.github/actions/sync-workspace/action.yml +++ b/.github/actions/sync-workspace/action.yml @@ -21,7 +21,7 @@ runs: packages/**/node_modules key: node-${{ runner.os }}-${{ runner.arch }}-${{ env.NODE_MODULE_CACHE_VERSION }}-${{ hashFiles('**/yarn.lock') }}-${{ inputs.package-json-checksum }} enableCrossOsArchive: true - fail-on-cache-miss: "!${{ fromJSON(env.REBUILD_PACKAGE) }} && true" + fail-on-cache-miss: "!${{ fromJSON(env.REBUILD_PACKAGE) }}" - name: Restore build artifacts cache uses: actions/cache/restore@v3 id: cache_build_artifacts @@ -43,7 +43,7 @@ runs: restore-keys: | code-${{ github.sha }} enableCrossOsArchive: true - fail-on-cache-miss: "!${{ fromJSON(env.REBUILD_PACKAGE) }} && true" + fail-on-cache-miss: "!${{ fromJSON(env.REBUILD_PACKAGE) }}" - name: Rebuild package shell: bash --login -eo pipefail {0} env: