Files
www/.github/workflows/ci-pipeline.yml
taroj1205 980883b5b1 fix(ci-pipeline): update Playwright job dependency from build to setup
- Changed the dependency of the Playwright job to run after the setup job instead of the build job, ensuring proper execution order in the CI workflow.
2025-05-16 12:42:57 +12:00

100 lines
2.6 KiB
YAML

name: CI Pipeline
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Cache node_modules
id: cache-deps
uses: actions/cache@v4
with:
path: |
node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- name: Verify npm installation
run: npm --version
- name: Install dependencies
run: npm ci
biome:
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
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- name: Run Biome check
run: npx biome check ./src
vitest:
runs-on: ubuntu-latest
needs: setup
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Restore node_modules from cache
uses: actions/cache@v4
with:
path: |
node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- name: Run Vitest tests
run: npx vitest run
build:
runs-on: ubuntu-latest
needs: setup
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Restore node_modules from cache
uses: actions/cache@v4
with:
path: |
node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- name: Build project
run: npm run build
playwright:
runs-on: ubuntu-latest
needs: setup
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Restore node_modules from cache
uses: actions/cache@v4
with:
path: |
node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test