46 lines
1.1 KiB
YAML
46 lines
1.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest-2
|
|
steps:
|
|
- name: 克隆本地 checkout action
|
|
run: |
|
|
git clone http://114.67.155.184:3000/niyyzf/checkout.git ./.actions/checkout
|
|
|
|
- name: 检出代码
|
|
uses: ./.actions/checkout
|
|
|
|
- name: 安装 Node.js
|
|
run: |
|
|
curl -fsSL https://deb.nodesource.com/setup_21.x | bash -
|
|
apt-get install -y nodejs
|
|
|
|
- name: 安装前端依赖
|
|
working-directory: platform
|
|
run: npm install
|
|
|
|
- name: 构建前端(跳过 ts 校验)
|
|
working-directory: platform
|
|
run: |
|
|
npm run build -- --no-check || true
|
|
|
|
- name: 安装 Python
|
|
run: |
|
|
apt-get update
|
|
apt-get install -y python3 python3-pip
|
|
|
|
- name: 安装后端依赖
|
|
working-directory: back
|
|
run: pip3 install -r requirements.txt
|
|
|
|
- name: 运行后端测试(如有)
|
|
working-directory: back
|
|
run: |
|
|
if [ -f tests/test.py ]; then python3 -m unittest discover -s tests; fi
|
|
|
|
- name: 构建 Docker 镜像
|
|
run: docker-compose build |