refactor(ci-pipeline): streamline CI steps by reorganizing dependency installation and restoring cache

- Moved Playwright browser installation and project build steps to the appropriate locations in the CI pipeline.
- Removed redundant cache paths for Playwright, optimizing the workflow.
This commit is contained in:
taroj1205
2025-05-16 11:33:40 +12:00
parent ed2412c35b
commit 056ef53172

View File

@@ -17,34 +17,11 @@ jobs:
with:
path: |
node_modules
~/.cache/ms-playwright
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
build-check:
runs-on: ubuntu-latest
needs: setup
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Restore node_modules from cache
uses: actions/cache@v4
with:
path: |
node_modules
~/.cache/ms-playwright
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- name: Verify npm installation
run: npm --version
- name: Build project
run: npm run build
- name: Install dependencies
run: npm ci
biome:
runs-on: ubuntu-latest
@@ -61,7 +38,6 @@ jobs:
with:
path: |
node_modules
~/.cache/ms-playwright
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- name: Run Biome check
run: npx biome check ./src
@@ -79,7 +55,6 @@ jobs:
with:
path: |
node_modules
~/.cache/ms-playwright
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- name: Run Vitest tests
run: npx vitest run
@@ -97,8 +72,11 @@ jobs:
with:
path: |
node_modules
~/.cache/ms-playwright
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Build project
run: npm run build
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4