feat(ci): 添加CI/CD工作流和CQRS命令接口

- 配置CI构建和测试工作流,支持多.NET版本和并发测试
- 添加CodeQL静态代码分析工作流
- 实现自动版本递增和标签创建工作流
- 定义CQRS命令接口规范,包括响应式和流式命令
- 为架构测试添加空值参数异常文档注释
This commit is contained in:
GeWuYou 2026-04-15 12:47:22 +08:00
parent 27266d037d
commit 0cd1e9e83a
4 changed files with 22 additions and 16 deletions

View File

@ -5,6 +5,8 @@ on:
workflows: ["CI - Build & Test"]
types:
- completed
branches:
- main
workflow_dispatch:
concurrency:
group: auto-tag-main
@ -13,15 +15,16 @@ concurrency:
jobs:
auto-tag:
if: >
github.ref == 'refs/heads/main' &&
(
(
github.event_name == 'workflow_run' &&
github.event.workflow_run.conclusion == 'success' &&
contains(github.event.workflow_run.head_commit.message, '[release ci]')
)
||
github.event_name == 'workflow_dispatch'
github.event_name == 'workflow_run' &&
github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.head_branch == 'main' &&
contains(github.event.workflow_run.head_commit.message, '[release ci]')
)
||
(
github.event_name == 'workflow_dispatch' &&
github.ref == 'refs/heads/main'
)
runs-on: ubuntu-latest
@ -61,4 +64,4 @@ jobs:
fi
git tag -a "$TAG" -m "Auto tag $TAG"
git push "https://x-access-token:${PAT}@github.com/${{ github.repository }}.git" "$TAG"
git push "https://x-access-token:${PAT}@github.com/${{ github.repository }}.git" "$TAG"

View File

@ -1,12 +1,12 @@
# CI/CD工作流配置构建和测试.NET项目
# 该工作流在push到main/master分支或创建pull request时触发
# 该工作流在推送到任意分支或创建面向任意分支的 pull request 时触发
name: CI - Build & Test
on:
push:
branches: [ main, master ]
branches: [ '**' ]
pull_request:
branches: [ main, master ]
branches: [ '**' ]
permissions:
contents: read

View File

@ -4,14 +4,14 @@ name: "CodeQL"
# 触发事件配置
# 在以下情况下触发工作流:
# 1. 推送到main分支时
# 2. 针对main分支的拉取请求时
# 1. 推送到任意分支时
# 2. 针对任意分支的拉取请求时
# 3. 每天凌晨2点执行一次
on:
push:
branches: [ "main" ]
branches: [ '**' ]
pull_request:
branches: [ "main" ]
branches: [ '**' ]
schedule:
- cron: '0 2 * * *'

View File

@ -168,6 +168,9 @@ internal sealed class AdditionalAssemblyNotificationHandlerRegistry : ICqrsHandl
/// </summary>
/// <param name="services">目标服务集合。</param>
/// <param name="logger">日志记录器。</param>
/// <exception cref="ArgumentNullException">
/// 当 <paramref name="services" /> 或 <paramref name="logger" /> 为 <see langword="null" /> 时抛出。
/// </exception>
public void Register(IServiceCollection services, ILogger logger)
{
ArgumentNullException.ThrowIfNull(services);