-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: cache deps in github actions (#111)
* test cache actions * remove test action deployment * update publish-beta action --------- Co-authored-by: Eugene Chybisov <[email protected]>
- Loading branch information
Showing
4 changed files
with
56 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: 'Yarn install' | ||
description: 'Run yarn install with node_modules linker and cache enabled' | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Expose yarn config as "$GITHUB_OUTPUT" | ||
id: yarn-config | ||
shell: bash | ||
run: | | ||
echo "CACHE_FOLDER=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT | ||
# Yarn rotates the downloaded cache archives, @see https://github.com/actions/setup-node/issues/325 | ||
# Yarn cache is also reusable between arch and os. | ||
- name: Restore yarn cache | ||
uses: actions/cache@v3 | ||
id: yarn-download-cache | ||
with: | ||
path: ${{ steps.yarn-config.outputs.CACHE_FOLDER }} | ||
key: yarn-download-cache-${{ hashFiles('yarn.lock') }} | ||
restore-keys: | | ||
yarn-download-cache- | ||
# Invalidated on yarn.lock changes | ||
- name: Restore yarn install state | ||
id: yarn-install-state-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: .yarn/ci-cache/ | ||
key: ${{ runner.os }}-yarn-install-state-cache-${{ hashFiles('yarn.lock', '.yarnrc.yml') }} | ||
|
||
- name: Install dependencies | ||
env: | ||
# CI optimizations. Overrides yarnrc.yml options (or their defaults) in the CI action. | ||
YARN_ENABLE_GLOBAL_CACHE: 'false' # Use local cache folder to keep downloaded archives | ||
YARN_NM_MODE: 'hardlinks-local' # Hardlinks-(local|global) reduces io / node_modules size | ||
YARN_INSTALL_STATE_PATH: .yarn/ci-cache/install-state.gz # Very small speedup when lock does not change | ||
# Other environment variables | ||
HUSKY: '0' # By default do not run HUSKY install | ||
shell: bash | ||
run: | | ||
yarn install --immutable --inline-builds |
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
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