Skip to content
This repository was archived by the owner on Aug 18, 2025. It is now read-only.

Commit f4dcd31

Browse files
committed
删除多个测试文件和示例文件以清理代码库,移除不再使用的代码和测试用例。
1 parent bea4c6f commit f4dcd31

37 files changed

+25
-1078
lines changed

.github/workflows/build_interpreter.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ on:
66
paths-ignore:
77
- 'library_*/**'
88
- '**.md'
9+
tags:
10+
- 'v*' # 添加标签触发
911
pull_request:
1012
branches: [ main ]
1113
paths-ignore:
1214
- 'library_*/**'
1315
- '**.md'
16+
release:
17+
types: [created] # 发布版本时触发
1418
workflow_dispatch: # 允许手动触发
1519

1620
env:
@@ -96,8 +100,9 @@ jobs:
96100

97101
- name: 创建发布
98102
uses: softprops/action-gh-release@v1
99-
if: startsWith(github.ref, 'refs/tags/')
103+
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release'
100104
with:
101105
files: ${{ matrix.asset_name }}
106+
tag_name: ${{ github.ref_name }}
102107
env:
103108
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/build_libraries.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
name: 构建CodeNothing库文件
22

33
on:
4-
# 默认只能手动触发,避免每次提交都构建
4+
# 手动触发
55
workflow_dispatch:
66
inputs:
77
libraries:
88
description: '要构建的库列表 (all 表示全部, 或用逗号分隔的名称列表如 io,example)'
99
required: true
1010
default: 'all'
11+
# 发布版本时自动触发
12+
release:
13+
types: [created]
14+
# 标签推送时自动触发
15+
push:
16+
tags:
17+
- 'v*'
1118

1219
env:
1320
CARGO_TERM_COLOR: always
@@ -24,12 +31,13 @@ jobs:
2431
- id: set-matrix
2532
name: 准备库矩阵
2633
run: |
27-
if [[ "${{ github.event.inputs.libraries }}" == "all" ]]; then
28-
# 自动查找所有以library_开头的目录
29-
LIBRARIES=$(find . -maxdepth 1 -type d -name "library_*" | sed 's|./library_||g' | jq -R . | jq -cs .)
30-
else
34+
# 如果是手动触发并指定了库,则使用指定的库
35+
if [[ "${{ github.event_name }}" == "workflow_dispatch" && "${{ github.event.inputs.libraries }}" != "all" ]]; then
3136
# 使用提供的库列表
3237
LIBRARIES=$(echo "${{ github.event.inputs.libraries }}" | tr ',' '\n' | jq -R . | jq -cs .)
38+
else
39+
# 否则构建所有库
40+
LIBRARIES=$(find . -maxdepth 1 -type d -name "library_*" | sed 's|./library_||g' | jq -R . | jq -cs .)
3341
fi
3442
echo "matrix=${LIBRARIES}" >> $GITHUB_OUTPUT
3543
shell: bash
@@ -146,10 +154,11 @@ jobs:
146154
path: ${{ matrix.library }}-${{ matrix.os }}.${{ matrix.archive_format }}
147155

148156
- name: 创建发布
149-
if: steps.check_dir.outputs.exists == 'true' && startsWith(github.ref, 'refs/tags/')
157+
if: steps.check_dir.outputs.exists == 'true' && (startsWith(github.ref, 'refs/tags/') || github.event_name == 'release')
150158
uses: softprops/action-gh-release@v1
151159
with:
152160
files: ${{ matrix.library }}-${{ matrix.os }}.${{ matrix.archive_format }}
161+
tag_name: ${{ github.ref_name }}
153162
env:
154163
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
155164

@@ -158,7 +167,8 @@ jobs:
158167
name: 打包所有库
159168
needs: build
160169
runs-on: ${{ matrix.os }}
161-
if: ${{ github.event.inputs.libraries == 'all' }}
170+
# 在手动触发并指定'all'或发布版本时打包所有库
171+
if: ${{ github.event.inputs.libraries == 'all' || github.event_name == 'release' || startsWith(github.ref, 'refs/tags/') }}
162172
strategy:
163173
matrix:
164174
os: [windows-latest, ubuntu-latest, macos-latest]
@@ -222,9 +232,10 @@ jobs:
222232
path: codenothing-all-libraries-${{ matrix.os }}.${{ matrix.archive_format }}
223233

224234
- name: 创建发布
225-
if: startsWith(github.ref, 'refs/tags/')
235+
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release'
226236
uses: softprops/action-gh-release@v1
227237
with:
228238
files: codenothing-all-libraries-${{ matrix.os }}.${{ matrix.archive_format }}
239+
tag_name: ${{ github.ref_name }}
229240
env:
230241
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
File renamed without changes.

library_test.cn

Lines changed: 0 additions & 21 deletions
This file was deleted.

testfiles/break_continue_test.cn

Lines changed: 0 additions & 119 deletions
This file was deleted.

testfiles/complex_comment_test.cn

Lines changed: 0 additions & 50 deletions
This file was deleted.

testfiles/complex_loop_test.cn

Lines changed: 0 additions & 50 deletions
This file was deleted.

testfiles/helloworld.cn

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)