From 0c2d372a693796fac627662220635a2f81fe5bfc Mon Sep 17 00:00:00 2001 From: qianmoQ Date: Sun, 29 Dec 2024 14:31:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B5=8B=E8=AF=95=20ci?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pageforge-ci.yml | 65 ++++++++++++++++++++++++++++++ example/index.md | 8 ++++ 2 files changed, 73 insertions(+) create mode 100644 .github/workflows/pageforge-ci.yml diff --git a/.github/workflows/pageforge-ci.yml b/.github/workflows/pageforge-ci.yml new file mode 100644 index 0000000..3cf05f6 --- /dev/null +++ b/.github/workflows/pageforge-ci.yml @@ -0,0 +1,65 @@ +name: PageForge CI + +on: + push: + branches: [ dev ] + pull_request: + branches: [ dev ] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [16.x, 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 }} + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Link package globally + run: | + npm link + npm link pageforge + + - name: Run linting + run: npm run lint || echo "No lint script found" + + - name: Run unit tests + run: npm 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: npm run build || echo "No build script found" \ No newline at end of file diff --git a/example/index.md b/example/index.md index e3fa5f6..1f81380 100644 --- a/example/index.md +++ b/example/index.md @@ -85,3 +85,11 @@ PageForge 是一款现代化的静态页面生成与部署平台,旨在帮助 ![alt文本](https://raw.githubusercontent.com/devlive-community/pageforge/d751a0bdc90e4cdd8b124a6c8b2adb499c47025f/assets/logo.svg "图片标题" =600x200 center) +# 表格 + +--- + +| 标题1 | 标题2 | 标题3 | +| --- | --- | --- | +| 内容1 | 内容2 | 内容3 | +| 内容1 | 内容2 | 内容3 | \ No newline at end of file