Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added submodules to gihub action test #10373

Merged
merged 6 commits into from
Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions .github/actions/sync-workspace/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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) }}"
- 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
Expand All @@ -35,4 +43,12 @@ runs:
restore-keys: |
code-${{ github.sha }}
enableCrossOsArchive: true
fail-on-cache-miss: true
fail-on-cache-miss: "!${{ fromJSON(env.REBUILD_PACKAGE) }}"
- 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
11 changes: 7 additions & 4 deletions .github/workflows/circleci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -331,10 +332,13 @@ 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 }}
rebuild-package: 'true'
- name: Build protocol
run: |
yarn --cwd packages/protocol build
Expand Down Expand Up @@ -753,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
Expand All @@ -768,4 +772,3 @@ jobs:
- name: Build and run command
run: |
${{ matrix.command }}

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,4 @@
"websocket-extensions": "^0.1.4",
"y18n": "^5.0.5"
}
}
}