-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (65 loc) · 2.62 KB
/
Copy pathci.yml
File metadata and controls
85 lines (65 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Restore core
run: dotnet restore Dignite.Paperbase.slnx
- name: Build core
run: dotnet build Dignite.Paperbase.slnx --no-restore --configuration Release
- name: Restore host
run: dotnet restore host/src/Dignite.Paperbase.Host.csproj
- name: Build host
run: dotnet build host/src/Dignite.Paperbase.Host.csproj --no-restore --configuration Release
- name: Run domain tests
run: dotnet test core/test/Dignite.Paperbase.Domain.Tests/Dignite.Paperbase.Domain.Tests.csproj --no-build --configuration Release --verbosity normal
- name: Run application tests
run: dotnet test core/test/Dignite.Paperbase.Application.Tests/Dignite.Paperbase.Application.Tests.csproj --no-build --configuration Release --verbosity normal
- name: Build Docker image
run: docker build -f host/Dockerfile -t paperbase-api:${{ github.sha }} .
if: github.event_name == 'push'
build-angular:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: angular/package-lock.json
- name: Install dependencies
run: npm ci
working-directory: angular
- name: Build paperbase library
run: npx nx build paperbase --configuration production
working-directory: angular
- name: Build host application
run: npx nx build host --configuration production
working-directory: angular
- name: Lint
run: npx nx run-many -t lint
working-directory: angular
# Unit tests run on plain Vitest (jsdom) via vitest.config.mts, not the
# `@angular/build:unit-test` builder — see vitest.setup.ts for the rationale.
- name: Unit tests
run: npx vitest run
working-directory: angular
# 验证前端 .local 镜像可构建(COPY 路径不回归)。上面的 nx build host 已产出
# dist/host/browser,此处只打包不推送;context = angular/。
- name: Build Angular Docker image
run: docker build -f apps/host/Dockerfile.local -t paperbase-web:${{ github.sha }} .
working-directory: angular
if: github.event_name == 'push'