mirror of
https://github.com/lainbo/component-party.git
synced 2026-04-05 04:59:02 +08:00
v3: Technical refactor (#302)
This commit is contained in:
committed by
GitHub
parent
f9cf2c60a5
commit
54eeee51b4
30
.github/actions/setup-node-pnpm/action.yml
vendored
Normal file
30
.github/actions/setup-node-pnpm/action.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
name: "Setup Node.js and pnpm"
|
||||
description: "Setup Node.js and pnpm with caching"
|
||||
inputs:
|
||||
node-version:
|
||||
description: "Node.js version to use"
|
||||
required: false
|
||||
default: "22.18.0"
|
||||
pnpm-version:
|
||||
description: "pnpm version to use"
|
||||
required: false
|
||||
default: "10.14.0"
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Setup PNPM
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: ${{ inputs.pnpm-version }}
|
||||
run_install: false
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ inputs.node-version }}
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: pnpm install --frozen-lockfile
|
||||
34
.github/workflows/build.yml
vendored
34
.github/workflows/build.yml
vendored
@@ -1,34 +0,0 @@
|
||||
name: Node.js Build
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
NODE_OPTIONS: --max_old_space_size=4096
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
# Read Node version from .nvmrc
|
||||
- name: Read Node version from .nvmrc
|
||||
id: nvm
|
||||
run: echo "NODE_VERSION=$(cat .nvmrc)" >> $GITHUB_OUTPUT
|
||||
|
||||
# Setup Node.js with the version from .nvmrc
|
||||
- name: Use Node.js version from .nvmrc
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ steps.nvm.outputs.NODE_VERSION }}
|
||||
|
||||
- name: Setup PNPM
|
||||
uses: pnpm/action-setup@v4.0.0
|
||||
|
||||
- run: pnpm install --frozen-lockfile
|
||||
|
||||
# - run: pnpm run lint # uncomment when eslint is fixed
|
||||
- run: pnpm run build
|
||||
40
.github/workflows/ci.yml
vendored
Normal file
40
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
env:
|
||||
NODE_OPTIONS: --max_old_space_size=4096
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
timeout-minutes: 30
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js and pnpm
|
||||
uses: ./.github/actions/setup-node-pnpm
|
||||
|
||||
- name: Build application
|
||||
run: pnpm run build
|
||||
|
||||
- name: Run checks
|
||||
run: pnpm check:ci
|
||||
|
||||
- name: Install Playwright Chromium
|
||||
run: pnpm run test:e2e:install
|
||||
|
||||
- name: Run Playwright tests
|
||||
run: pnpm run test:e2e
|
||||
|
||||
- name: Upload test results
|
||||
uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: playwright-report
|
||||
path: playwright-report/
|
||||
retention-days: 30
|
||||
16
.github/workflows/e2e.yml
vendored
16
.github/workflows/e2e.yml
vendored
@@ -1,16 +0,0 @@
|
||||
name: End-to-end tests
|
||||
on: push
|
||||
jobs:
|
||||
cypress-run:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup PNPM
|
||||
uses: pnpm/action-setup@v4.0.0
|
||||
- name: Cypress run
|
||||
uses: cypress-io/github-action@v6
|
||||
with:
|
||||
build: pnpm build
|
||||
start: pnpm preview --port 5173
|
||||
browser: chrome
|
||||
36
.github/workflows/setup-node-pnpm.yml
vendored
Normal file
36
.github/workflows/setup-node-pnpm.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
name: Setup Node.js and pnpm
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
node-version:
|
||||
description: "Node.js version to use"
|
||||
required: false
|
||||
type: string
|
||||
default: "22.18.0"
|
||||
pnpm-version:
|
||||
description: "pnpm version to use"
|
||||
required: false
|
||||
type: string
|
||||
default: "10.14.0"
|
||||
|
||||
jobs:
|
||||
setup:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup PNPM
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: ${{ inputs.pnpm-version }}
|
||||
run_install: false
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ inputs.node-version }}
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
Reference in New Issue
Block a user