-
Notifications
You must be signed in to change notification settings - Fork 915
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CI] Improve yarn's performance in workflows by caching yarn's cache …
…folder Signed-off-by: Miki <[email protected]>
- Loading branch information
Showing
2 changed files
with
94 additions
and
12 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 |
---|---|---|
|
@@ -45,6 +45,19 @@ jobs: | |
run: | | ||
npm uninstall -g yarn | ||
npm i -g [email protected] | ||
yarn config set network-timeout 1000000 -g | ||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- uses: actions/cache@v3 | ||
id: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
yarn- | ||
- name: Run bootstrap | ||
run: yarn osd bootstrap | ||
|
@@ -103,14 +116,22 @@ jobs: | |
run: | | ||
npm uninstall -g yarn | ||
npm i -g [email protected] | ||
yarn config set network-timeout 1000000 -g | ||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- uses: actions/cache@v3 | ||
id: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
yarn- | ||
# https://github.com/yarnpkg/yarn/issues/8242#issuecomment-776561223 | ||
# Increase network timeout for Windows, retry once if bootstrap fails | ||
- name: Run bootstrap | ||
run: | | ||
yarn cache clean | ||
yarn config set network-timeout 1000000 -g | ||
yarn osd bootstrap || yarn osd bootstrap | ||
run: yarn osd bootstrap || yarn osd bootstrap | ||
|
||
- name: Run linter | ||
id: linter | ||
|
@@ -164,6 +185,19 @@ jobs: | |
run: | | ||
npm uninstall -g yarn | ||
npm i -g [email protected] | ||
yarn config set network-timeout 1000000 -g | ||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- uses: actions/cache@v3 | ||
id: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
yarn- | ||
- name: Setup chromedriver | ||
run: node scripts/upgrade_chromedriver.js | ||
|
@@ -223,17 +257,25 @@ jobs: | |
run: | | ||
npm uninstall -g yarn | ||
npm i -g [email protected] | ||
yarn config set network-timeout 1000000 -g | ||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- uses: actions/cache@v3 | ||
id: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
yarn- | ||
- name: Setup chromedriver | ||
run: node scripts/upgrade_chromedriver.js | ||
|
||
# https://github.com/yarnpkg/yarn/issues/8242#issuecomment-776561223 | ||
# Increase network timeout for Windows, retry once if bootstrap fails | ||
- name: Run bootstrap | ||
run: | | ||
yarn cache clean | ||
yarn config set network-timeout 1000000 -g | ||
yarn osd bootstrap || yarn osd bootstrap | ||
run: yarn osd bootstrap || yarn osd bootstrap | ||
|
||
- name: Build plugins | ||
run: node scripts/build_opensearch_dashboards_platform_plugins --no-examples --workers 10 | ||
|
@@ -291,6 +333,19 @@ jobs: | |
run: | | ||
npm uninstall -g yarn | ||
npm i -g [email protected] | ||
yarn config set network-timeout 1000000 -g | ||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- uses: actions/cache@v3 | ||
id: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
yarn- | ||
- name: Get package version | ||
run: | | ||
|
@@ -347,6 +402,19 @@ jobs: | |
run: | | ||
npm uninstall -g yarn | ||
npm i -g [email protected] | ||
yarn config set network-timeout 1000000 -g | ||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- uses: actions/cache@v3 | ||
id: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
yarn- | ||
- name: Get package version | ||
run: | | ||
|
@@ -401,6 +469,19 @@ jobs: | |
run: | | ||
npm uninstall -g yarn | ||
npm i -g [email protected] | ||
yarn config set network-timeout 1000000 -g | ||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- uses: actions/cache@v3 | ||
id: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
yarn- | ||
- name: Get package version | ||
run: | | ||
|
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