-
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
93 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,18 @@ jobs: | |
run: | | ||
npm uninstall -g yarn | ||
npm i -g [email protected] | ||
yarn config set network-timeout 1000000 -g | ||
- name: Configure Yarn Cache | ||
run: echo "YARN_CACHE_LOCATION=$(yarn cache dir)" >> $GITHUB_ENV | ||
|
||
- name: Initialize Yarn Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.YARN_CACHE_LOCATION }} | ||
key: yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
yarn- | ||
- name: Run bootstrap | ||
run: yarn osd bootstrap | ||
|
@@ -103,14 +115,23 @@ jobs: | |
run: | | ||
npm uninstall -g yarn | ||
npm i -g [email protected] | ||
yarn config set network-timeout 1000000 -g | ||
# https://github.com/yarnpkg/yarn/issues/8242#issuecomment-776561223 | ||
# Increase network timeout for Windows, retry once if bootstrap fails | ||
- name: Run bootstrap | ||
- name: Configure Yarn Cache | ||
run: | | ||
yarn cache clean | ||
yarn config set network-timeout 1000000 -g | ||
yarn osd bootstrap || yarn osd bootstrap | ||
echo "YARN_CACHE_LOCATION=$(yarn cache dir)" >> $env:GITHUB_ENV | ||
echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%" | ||
- name: Initialize Yarn Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.YARN_CACHE_LOCATION }} | ||
key: yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
yarn- | ||
- name: Run bootstrap | ||
run: yarn osd bootstrap || yarn osd bootstrap | ||
|
||
- name: Run linter | ||
id: linter | ||
|
@@ -164,6 +185,18 @@ jobs: | |
run: | | ||
npm uninstall -g yarn | ||
npm i -g [email protected] | ||
yarn config set network-timeout 1000000 -g | ||
- name: Configure Yarn Cache | ||
run: echo "YARN_CACHE_LOCATION=$(yarn cache dir)" >> $GITHUB_ENV | ||
|
||
- name: Initialize Yarn Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.YARN_CACHE_LOCATION }} | ||
key: yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
yarn- | ||
- name: Setup chromedriver | ||
run: node scripts/upgrade_chromedriver.js | ||
|
@@ -223,17 +256,26 @@ jobs: | |
run: | | ||
npm uninstall -g yarn | ||
npm i -g [email protected] | ||
yarn config set network-timeout 1000000 -g | ||
- name: Configure Yarn Cache | ||
run: | | ||
echo "YARN_CACHE_LOCATION=$(yarn cache dir)" >> $env:GITHUB_ENV | ||
echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%" | ||
- name: Initialize Yarn Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.YARN_CACHE_LOCATION }} | ||
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,18 @@ jobs: | |
run: | | ||
npm uninstall -g yarn | ||
npm i -g [email protected] | ||
yarn config set network-timeout 1000000 -g | ||
- name: Configure Yarn Cache | ||
run: echo "YARN_CACHE_LOCATION=$(yarn cache dir)" >> $GITHUB_ENV | ||
|
||
- name: Initialize Yarn Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.YARN_CACHE_LOCATION }} | ||
key: yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
yarn- | ||
- name: Get package version | ||
run: | | ||
|
@@ -347,6 +401,20 @@ jobs: | |
run: | | ||
npm uninstall -g yarn | ||
npm i -g [email protected] | ||
yarn config set network-timeout 1000000 -g | ||
- name: Configure Yarn Cache | ||
run: | | ||
echo "YARN_CACHE_LOCATION=$(yarn cache dir)" >> $env:GITHUB_ENV | ||
echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%" | ||
- name: Initialize Yarn Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.YARN_CACHE_LOCATION }} | ||
key: yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
yarn- | ||
- name: Get package version | ||
run: | | ||
|
@@ -401,6 +469,18 @@ jobs: | |
run: | | ||
npm uninstall -g yarn | ||
npm i -g [email protected] | ||
yarn config set network-timeout 1000000 -g | ||
- name: Configure Yarn Cache | ||
run: echo "YARN_CACHE_LOCATION=$(yarn cache dir)" >> $GITHUB_ENV | ||
|
||
- name: Initialize Yarn Cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ env.YARN_CACHE_LOCATION }} | ||
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