Skip to content

修复缺失的依赖 #3

修复缺失的依赖

修复缺失的依赖 #3

Workflow file for this run

name: PageForge CI
on:
push:
branches: [ dev ]
pull_request:
branches: [ dev ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Link package globally
run: |
pnpm link --global
pnpm link --global pageforge
- name: Run linting
run: pnpm run lint || echo "No lint script found"
- name: Run unit tests
run: pnpm test || echo "No test script found"
- name: Test create-site command
run: |
mkdir -p test-sites
pageforge create-site test-sites/test-site
test -d test-sites/test-site || exit 1
- name: Test init command
run: |
cd test-sites/test-site
pageforge init
test -f pageforge.yml || exit 1
- name: Test build command
run: |
cd test-sites/test-site
pageforge build
test -d dist || exit 1
- name: Test serve command
run: |
cd test-sites/test-site
timeout 30s pageforge serve --port 3001 &
sleep 5
curl -f http://localhost:3001 || exit 1
- name: Build project
run: pnpm run build || echo "No build script found"