mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-12-19 05:05:44 +08:00
Inserts 'pnpm test' into both build jobs in the GitHub Actions workflow to ensure tests are run during CI before building artifacts.
63 lines
1.7 KiB
YAML
63 lines
1.7 KiB
YAML
name: Build NapCat Artifacts
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
permissions: write-all
|
|
|
|
jobs:
|
|
Build-Framework:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Clone Main Repository
|
|
uses: actions/checkout@v4
|
|
- name: Use Node.js 20.X
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20.x
|
|
- name: Build NapCat.Framework
|
|
run: |
|
|
npm i -g pnpm
|
|
pnpm i
|
|
pnpm run typecheck || exit 1
|
|
pnpm test || exit 1
|
|
pnpm --filter napcat-webui-frontend run build || exit 1
|
|
pnpm run build:framework
|
|
mv packages/napcat-framework/dist framework-dist
|
|
cd framework-dist
|
|
npm install --omit=dev
|
|
rm ./package-lock.json || exit 0
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: NapCat.Framework
|
|
path: framework-dist
|
|
Build-Shell:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Clone Main Repository
|
|
uses: actions/checkout@v4
|
|
- name: Use Node.js 20.X
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20.x
|
|
- name: Build NapCat.Shell
|
|
run: |
|
|
npm i -g pnpm
|
|
pnpm i
|
|
pnpm run typecheck || exit 1
|
|
pnpm test || exit 1
|
|
pnpm --filter napcat-webui-frontend run build || exit 1
|
|
pnpm run build:shell
|
|
mv packages/napcat-shell/dist shell-dist
|
|
cd shell-dist
|
|
npm install --omit=dev
|
|
rm ./package-lock.json || exit 0
|
|
- name: Upload Artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: NapCat.Shell
|
|
path: shell-dist
|