The home for Hyperlane core contracts, sdk packages, and other infrastructure
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hyperlane-monorepo/.github/actions/yarn-build-with-cache/action.yml

38 lines
919 B

feat: remove extraneous caching (#4469) feat: remove yarn build cache - saves 600MB of cache space PER COMMIT - doesn't impact overall per-commit CI time - better CI time in the general case due to fewer cache evictions on the e2e matrix job - [with caching](https://github.com/hyperlane-xyz/hyperlane-monorepo/actions/runs/10797745470) vs [no caching](https://github.com/hyperlane-xyz/hyperlane-monorepo/actions/runs/10797213927?pr=4469) drive-by: disable docker caching for agent build - currently cache has no impact on build time of the agent image - rerunning builds for a commit or pushing empty commits should in theory lead to quicker builds with layer caching, but the main problem is that the `RUN` step of building the agents is not cached by the docker action - only RUNs with bind mounts get a checksum computed [(reference)](https://docs.docker.com/build/cache/invalidation/#general-rules) - disabling docker build caching could help save a bunch of cache space - best way to 4x speed here is moving this job to a buildjet 8vcpu runner (read [here](https://github.com/hyperlane-xyz/hyperlane-monorepo/pull/4445) for more info) drive-by: TLC - update to latest docker build action - provides a nice build summary and can generate artifacts that help break down where build time is spent - update check-env before build, given the current deprecation annotations - https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ - coverage step doesn't need to wait for `yarn-test` anymore
3 months ago
name: 'Yarn Build with Cache'
description: 'Run yarn build using yarn cache'
inputs:
ref:
description: 'The Git ref to checkout'
required: true
runs:
using: "composite"
steps:
- name: Cache
uses: buildjet/cache@v4
id: cache
feat: remove extraneous caching (#4469) feat: remove yarn build cache - saves 600MB of cache space PER COMMIT - doesn't impact overall per-commit CI time - better CI time in the general case due to fewer cache evictions on the e2e matrix job - [with caching](https://github.com/hyperlane-xyz/hyperlane-monorepo/actions/runs/10797745470) vs [no caching](https://github.com/hyperlane-xyz/hyperlane-monorepo/actions/runs/10797213927?pr=4469) drive-by: disable docker caching for agent build - currently cache has no impact on build time of the agent image - rerunning builds for a commit or pushing empty commits should in theory lead to quicker builds with layer caching, but the main problem is that the `RUN` step of building the agents is not cached by the docker action - only RUNs with bind mounts get a checksum computed [(reference)](https://docs.docker.com/build/cache/invalidation/#general-rules) - disabling docker build caching could help save a bunch of cache space - best way to 4x speed here is moving this job to a buildjet 8vcpu runner (read [here](https://github.com/hyperlane-xyz/hyperlane-monorepo/pull/4445) for more info) drive-by: TLC - update to latest docker build action - provides a nice build summary and can generate artifacts that help break down where build time is spent - update check-env before build, given the current deprecation annotations - https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ - coverage step doesn't need to wait for `yarn-test` anymore
3 months ago
with:
path: |
**/node_modules
.yarn
key: ${{ runner.os }}-yarn-4.5.1-cache-${{ hashFiles('./yarn.lock') }}
# Typically, the cache will be hit, but if there's a network error when
# restoring the cache, let's run the install step ourselves.
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
shell: bash
run: |
yarn install
CHANGES=$(git status -s --ignore-submodules)
if [[ ! -z $CHANGES ]]; then
echo "Changes found: $CHANGES"
git diff
exit 1
fi
feat: remove extraneous caching (#4469) feat: remove yarn build cache - saves 600MB of cache space PER COMMIT - doesn't impact overall per-commit CI time - better CI time in the general case due to fewer cache evictions on the e2e matrix job - [with caching](https://github.com/hyperlane-xyz/hyperlane-monorepo/actions/runs/10797745470) vs [no caching](https://github.com/hyperlane-xyz/hyperlane-monorepo/actions/runs/10797213927?pr=4469) drive-by: disable docker caching for agent build - currently cache has no impact on build time of the agent image - rerunning builds for a commit or pushing empty commits should in theory lead to quicker builds with layer caching, but the main problem is that the `RUN` step of building the agents is not cached by the docker action - only RUNs with bind mounts get a checksum computed [(reference)](https://docs.docker.com/build/cache/invalidation/#general-rules) - disabling docker build caching could help save a bunch of cache space - best way to 4x speed here is moving this job to a buildjet 8vcpu runner (read [here](https://github.com/hyperlane-xyz/hyperlane-monorepo/pull/4445) for more info) drive-by: TLC - update to latest docker build action - provides a nice build summary and can generate artifacts that help break down where build time is spent - update check-env before build, given the current deprecation annotations - https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ - coverage step doesn't need to wait for `yarn-test` anymore
3 months ago
- name: Build
shell: bash
run: yarn build