mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-01-25 02:08:11 +00:00
perf(ui): optimize CI cache for pnpm and Next.js builds (#9843)
This commit is contained in:
14
.github/workflows/ui-e2e-tests.yml
vendored
14
.github/workflows/ui-e2e-tests.yml
vendored
@@ -125,16 +125,20 @@ jobs:
|
|||||||
- name: Get pnpm store directory
|
- name: Get pnpm store directory
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||||
- name: Setup pnpm cache
|
- name: Setup pnpm and Next.js cache
|
||||||
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
|
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
|
||||||
with:
|
with:
|
||||||
path: ${{ env.STORE_PATH }}
|
path: |
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('ui/pnpm-lock.yaml') }}
|
${{ env.STORE_PATH }}
|
||||||
|
./ui/node_modules
|
||||||
|
./ui/.next/cache
|
||||||
|
key: ${{ runner.os }}-pnpm-nextjs-${{ hashFiles('ui/pnpm-lock.yaml') }}-${{ hashFiles('ui/**/*.ts', 'ui/**/*.tsx', 'ui/**/*.js', 'ui/**/*.jsx') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-pnpm-store-
|
${{ runner.os }}-pnpm-nextjs-${{ hashFiles('ui/pnpm-lock.yaml') }}-
|
||||||
|
${{ runner.os }}-pnpm-nextjs-
|
||||||
- name: Install UI dependencies
|
- name: Install UI dependencies
|
||||||
working-directory: ./ui
|
working-directory: ./ui
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile --prefer-offline
|
||||||
- name: Build UI application
|
- name: Build UI application
|
||||||
working-directory: ./ui
|
working-directory: ./ui
|
||||||
run: pnpm run build
|
run: pnpm run build
|
||||||
|
|||||||
14
.github/workflows/ui-tests.yml
vendored
14
.github/workflows/ui-tests.yml
vendored
@@ -62,18 +62,22 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
run: echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Setup pnpm cache
|
- name: Setup pnpm and Next.js cache
|
||||||
if: steps.check-changes.outputs.any_changed == 'true'
|
if: steps.check-changes.outputs.any_changed == 'true'
|
||||||
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
|
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
|
||||||
with:
|
with:
|
||||||
path: ${{ env.STORE_PATH }}
|
path: |
|
||||||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('ui/pnpm-lock.yaml') }}
|
${{ env.STORE_PATH }}
|
||||||
|
${{ env.UI_WORKING_DIR }}/node_modules
|
||||||
|
${{ env.UI_WORKING_DIR }}/.next/cache
|
||||||
|
key: ${{ runner.os }}-pnpm-nextjs-${{ hashFiles('ui/pnpm-lock.yaml') }}-${{ hashFiles('ui/**/*.ts', 'ui/**/*.tsx', 'ui/**/*.js', 'ui/**/*.jsx') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-pnpm-store-
|
${{ runner.os }}-pnpm-nextjs-${{ hashFiles('ui/pnpm-lock.yaml') }}-
|
||||||
|
${{ runner.os }}-pnpm-nextjs-
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
if: steps.check-changes.outputs.any_changed == 'true'
|
if: steps.check-changes.outputs.any_changed == 'true'
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile --prefer-offline
|
||||||
|
|
||||||
- name: Run healthcheck
|
- name: Run healthcheck
|
||||||
if: steps.check-changes.outputs.any_changed == 'true'
|
if: steps.check-changes.outputs.any_changed == 'true'
|
||||||
|
|||||||
Reference in New Issue
Block a user