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

Improve build performance #733

Merged
merged 13 commits into from
Apr 3, 2023
18 changes: 18 additions & 0 deletions .github/workflows/v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ jobs:
- name: Install Dependencies
working-directory: v3
run: npm ci
- uses: actions/cache@v3
with:
path: v3/node_modules/.cache/webpack/
key: ${{ github.head_ref || github.ref_name }}-webpack-build
restore-keys: |
main-webpack-build
Comment on lines +23 to +28
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation suggests that setup-node can automatically cache what needs to be cached:

Alternatively, if you are caching the package managers listed below, using their respective setup-* actions requires minimal configuration and will create and restore dependency caches for you.

The documentation for actions/setup-node suggests that simply adding cache: true will have similar effect, potentially caching the entire node_modules folder. So it seems like caching is a good idea, but I think it would be good to understand and measure the difference between just specifying cache: true to setup-node and separately configuring actions/cache. And then the final choice should be documented with local comments so that if things change down the road the situation can be revisited.

- name: Build
working-directory: v3
run: npm run build
Expand All @@ -45,6 +51,12 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: v3/node_modules/.cache/webpack/
key: ${{ github.head_ref || github.ref_name }}-webpack-build
restore-keys: |
main-webpack-build
- uses: cypress-io/github-action@v5
with:
working-directory: v3
Expand Down Expand Up @@ -92,6 +104,12 @@ jobs:
# skip installing cypress since it isn't needed for just building
# This decreases the deploy time quite a bit
CYPRESS_INSTALL_BINARY: 0
- uses: actions/cache@v3
with:
path: v3/node_modules/.cache/webpack/
key: ${{ github.head_ref || github.ref_name }}-webpack-build
restore-keys: |
main-webpack-build
- uses: concord-consortium/s3-deploy-action@v1
with:
bucket: models-resources
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ cypress/screenshots
cypress/videos
cypress/downloads
cypress/snapshots/*/__diff_output__/**
v3/cypress/screenshots
Loading