Skip to content

Commit aeef8d7

Browse files
author
jinzhongjia
committed
chore(ci): update test workflow to trigger on main and PR events
- Add push to main and pull_request triggers for test workflow - Enhance run-name to label pull request runs with PR number - Remove workflow_run and related dependencies to simplify workflow triggers This streamlines CI runs and clarifies execution context for test jobs.
1 parent 6f5e9e1 commit aeef8d7

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

.github/workflows/test.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,20 @@
11
name: Unit Tests
22

3-
run-name: "🧪 Unit Tests · ${{ github.event_name == 'schedule' && 'Scheduled (master)' || (github.event_name == 'workflow_dispatch' && 'Manual Run' || github.event.workflow_run.head_branch) }}"
3+
run-name: "🧪 Unit Tests · ${{ github.event_name == 'schedule' && 'Scheduled (master)' || (github.event_name == 'workflow_dispatch' && 'Manual Run' || (github.event_name == 'pull_request' && format('PR #{0}', github.event.pull_request.number) || github.ref_name)) }}"
44

55
on:
6+
push:
7+
branches:
8+
- main
9+
pull_request:
610
schedule:
711
# 每天凌晨 2 点执行
812
- cron: "0 2 * * *"
913
workflow_dispatch:
10-
workflow_run:
11-
workflows: ["Code Format Check"]
12-
types:
13-
- completed
1414

1515
jobs:
1616
test:
1717
name: Unit Test (${{ matrix.os }} - ${{ matrix.arch }} - Zig ${{ matrix.version }})
18-
# 依赖 format check 成功,或定时任务/手动触发时执行
19-
if: |
20-
github.event_name == 'schedule' ||
21-
github.event_name == 'workflow_dispatch' ||
22-
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')
2318
strategy:
2419
matrix:
2520
# 架构配置标识符

0 commit comments

Comments
 (0)