-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adapt the actions to social-connect repo
- Loading branch information
1 parent
3901315
commit cb03bc5
Showing
2 changed files
with
70 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: "Sync workspace" | ||
description: "Sync GitHub Action workspace using GitHub cache" | ||
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: "!${{ fromJSON(env.REBUILD_PACKAGE) }}" | ||
- name: Restore build artifacts cache | ||
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 | ||
path: | | ||
packages/**/lib | ||
packages/**/dist | ||
packages/**/build | ||
packages/sdk/contractkit/src/generated | ||
key: code-${{ github.sha }} | ||
restore-keys: | | ||
code-${{ github.sha }} | ||
enableCrossOsArchive: 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 |