feat: add GitHub Actions workflow for running tests on push and pull request
This commit is contained in:
21
.github/workflows/build.yml
vendored
21
.github/workflows/build.yml
vendored
@@ -1,15 +1,15 @@
|
||||
name: 构建扩展
|
||||
name: 发布扩展
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 检出代码
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
- name: 配置 uv
|
||||
uses: astral-sh/setup-uv@v7
|
||||
with:
|
||||
python-version: "3.12"
|
||||
python-version: "3.11"
|
||||
|
||||
- name: 运行测试
|
||||
run: uv run --frozen pytest
|
||||
@@ -26,9 +26,8 @@ jobs:
|
||||
- name: 构建扩展
|
||||
run: uv run --frozen python pack.py
|
||||
|
||||
- name: 上传扩展包
|
||||
uses: actions/upload-artifact@v7
|
||||
- name: 发布扩展包
|
||||
uses: https://gitea.com/actions/gitea-release-action@v1.3.6
|
||||
with:
|
||||
name: SnapForm
|
||||
path: dist/*.zip
|
||||
if-no-files-found: error
|
||||
files: |-
|
||||
dist/*.zip
|
||||
|
||||
4
.github/workflows/docs.yml
vendored
4
.github/workflows/docs.yml
vendored
@@ -7,8 +7,6 @@ on:
|
||||
paths:
|
||||
- docs/**
|
||||
- mkdocs.yml
|
||||
- pyproject.toml
|
||||
- uv.lock
|
||||
- .github/workflows/docs.yml
|
||||
workflow_dispatch:
|
||||
|
||||
@@ -26,7 +24,7 @@ jobs:
|
||||
uses: astral-sh/setup-uv@v7
|
||||
|
||||
- name: 构建文档
|
||||
run: uv run --frozen mkdocs build --strict --site-dir site
|
||||
run: uv run --frozen --only-group docs mkdocs build --strict --site-dir site
|
||||
|
||||
- name: 整理发布目录
|
||||
run: |
|
||||
|
||||
26
.github/workflows/test.yml
vendored
Normal file
26
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
name: 运行测试
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 检出代码
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: 配置 uv
|
||||
uses: astral-sh/setup-uv@v7
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
- name: 运行测试
|
||||
run: uv run --frozen pytest
|
||||
Reference in New Issue
Block a user