mirror of
https://github.com/zen-browser/www
synced 2026-04-25 17:14:56 +02:00
- Changed the web server configuration to specify the URL as 'http://localhost:3000' for improved clarity in local development. </message> <message>feat(ci-pipeline): add artifact upload and download steps in CI workflow - Introduced steps to upload the build output as an artifact after the build job. - Added a step to download the build output artifact before running Playwright tests, ensuring the tests have access to the latest build.
111 lines
2.8 KiB
YAML
111 lines
2.8 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
|
|
- name: Upload build output
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: build
|
|
path: |
|
|
dist
|
|
|
|
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: Download build output
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: build
|
|
path: dist
|
|
- name: Run Playwright tests
|
|
run: npx playwright test |