mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
ci: speed up yarn install
This commit is contained in:
33
.github/actions/setup-node/action.yml
vendored
33
.github/actions/setup-node/action.yml
vendored
@@ -4,7 +4,7 @@ inputs:
|
|||||||
extra-flags:
|
extra-flags:
|
||||||
description: 'Extra flags to pass to the yarn install.'
|
description: 'Extra flags to pass to the yarn install.'
|
||||||
required: false
|
required: false
|
||||||
default: '--immutable'
|
default: '--immutable --inline-builds'
|
||||||
package-install:
|
package-install:
|
||||||
description: 'Run the install step.'
|
description: 'Run the install step.'
|
||||||
required: false
|
required: false
|
||||||
@@ -29,18 +29,27 @@ runs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: node scripts/module-resolve/ci.cjs
|
run: node scripts/module-resolve/ci.cjs
|
||||||
|
|
||||||
- name: Get yarn cache directory path
|
- name: Expose yarn config as "$GITHUB_OUTPUT"
|
||||||
id: yarn-cache-dir-path
|
id: yarn-config
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
|
run: |
|
||||||
|
echo "CACHE_FOLDER=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
- name: Restore yarn cache
|
||||||
id: yarn-cache
|
uses: actions/cache@v3
|
||||||
|
id: yarn-download-cache
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
path: ${{ steps.yarn-config.outputs.CACHE_FOLDER }}
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
key: yarn-download-cache-${{ hashFiles('yarn.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-yarn-
|
yarn-download-cache-
|
||||||
|
|
||||||
|
- 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: yarn install
|
- name: yarn install
|
||||||
if: ${{ inputs.package-install == 'true' }}
|
if: ${{ inputs.package-install == 'true' }}
|
||||||
@@ -49,6 +58,9 @@ runs:
|
|||||||
run: yarn install ${{ inputs.extra-flags }}
|
run: yarn install ${{ inputs.extra-flags }}
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ inputs.npm-token }}
|
NODE_AUTH_TOKEN: ${{ inputs.npm-token }}
|
||||||
|
YARN_ENABLE_GLOBAL_CACHE: 'false'
|
||||||
|
YARN_INSTALL_STATE_PATH: .yarn/ci-cache/install-state.gz
|
||||||
|
HUSKY: '0'
|
||||||
|
|
||||||
- name: yarn install (try again)
|
- name: yarn install (try again)
|
||||||
if: ${{ steps.install.outcome == 'failure' }}
|
if: ${{ steps.install.outcome == 'failure' }}
|
||||||
@@ -56,6 +68,9 @@ runs:
|
|||||||
run: yarn install ${{ inputs.extra-flags }}
|
run: yarn install ${{ inputs.extra-flags }}
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ inputs.npm-token }}
|
NODE_AUTH_TOKEN: ${{ inputs.npm-token }}
|
||||||
|
YARN_ENABLE_GLOBAL_CACHE: 'false'
|
||||||
|
YARN_INSTALL_STATE_PATH: .yarn/ci-cache/install-state.gz
|
||||||
|
HUSKY: '0'
|
||||||
|
|
||||||
- name: Get installed Playwright version
|
- name: Get installed Playwright version
|
||||||
id: playwright-version
|
id: playwright-version
|
||||||
|
|||||||
Reference in New Issue
Block a user