chore: remove debug step from frontend build workflow #27
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 智能IDE项目构建与测试 | |
on: | |
push: | |
branches: [ main, master ] | |
pull_request: | |
branches: [ main, master ] | |
jobs: | |
backend-build: | |
runs-on: ubuntu-latest | |
# 添加服务配置 | |
services: | |
# Redis服务配置 | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
# PostgreSQL服务配置 | |
postgres: | |
image: postgres:latest | |
ports: | |
- 5432:5432 | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: 123456 | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 设置Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: 安装Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
echo "$HOME/.poetry/bin" >> $GITHUB_PATH | |
- name: 配置Redis密码 | |
run: | | |
docker exec ${{ job.services.redis.id }} redis-cli config set requirepass 123456 | |
- name: 安装依赖 | |
run: | | |
poetry install | |
- name: 运行测试 | |
run: python build.py # 通过build.py直接运行测试,它已包含服务初始化和测试流程 | |
env: | |
REDIS_PASSWORD: "123456" | |
DOCKER_ENABLE: "false" # 禁用Docker容器管理,使用GitHub Actions提供的服务 | |
- name: 上传测试覆盖率报告 | |
uses: codecov/codecov-action@v3 | |
with: | |
directory: ./htmlcov # HTML报告输出目录更改为htmlcov | |
flags: backend | |
name: backend-coverage | |
frontend-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 设置Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: 安装Xvfb | |
run: sudo apt-get install -y xvfb | |
- name: 运行前端构建脚本 | |
run: xvfb-run --auto-servernum node frontend-build.js # 使用xvfb-run运行前端构建脚本 | |
- name: 发布到 VS Code Marketplace | |
run: vsce publish -p ${{ secrets.VSCE_PAT }} | |
working-directory: ./frontend/intelligent-ide | |
env: | |
VSCE_PAT: ${{ secrets.VSCE_PAT }} | |
- name: 上传测试覆盖率报告 | |
uses: codecov/codecov-action@v3 | |
with: | |
directory: ./frontend/intelligent-ide/coverage | |
flags: frontend | |
name: frontend-coverage |