diff --git a/packages/@o3r/pipeline/schematics/ng-add/templates/github/__dot__github/actions/setup/action.yml b/packages/@o3r/pipeline/schematics/ng-add/templates/github/__dot__github/actions/setup/action.yml index 2f6c6e6853..57708b94df 100644 --- a/packages/@o3r/pipeline/schematics/ng-add/templates/github/__dot__github/actions/setup/action.yml +++ b/packages/@o3r/pipeline/schematics/ng-add/templates/github/__dot__github/actions/setup/action.yml @@ -6,16 +6,26 @@ runs: steps: - uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4 with: - node-version: 20 - cache: <%= packageManager %> + node-version: 20<% if (packageManager !== 'yarn') { %> + cache: <%= packageManager %><% } %> - name: Enable Corepack shell: bash - run: corepack enable - - name: Install -<% if (npmRegistry) { %> + run: corepack enable<% if (packageManager === 'yarn') { %> + - name: Cache dependencies + uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2 + with: + path: | + .yarn/cache + .yarn/unplugged + .pnp.cjs + .pnp.loader.mjs + key: ${{ runner.os }}-deps-${{ hashFiles('yarn.lock') }} + restore-keys: | + ${{ runner.os }}-deps + ${{ runner.os }}<% } %> + - name: Install<% if (npmRegistry) { %> env: COREPACK_NPM_REGISTRY: <%= npmRegistry %> - COREPACK_INTEGRITY_KEYS: "" -<% } %> + COREPACK_INTEGRITY_KEYS: ""<% } %> shell: bash run: <%= setupCommand %>