-
Notifications
You must be signed in to change notification settings - Fork 1
85 lines (68 loc) · 2.72 KB
/
Copy pathci.yml
File metadata and controls
85 lines (68 loc) · 2.72 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: [master]
pull_request:
branches: [master]
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: Build and test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# WPF only builds on Windows. The server-only Linux job below covers Linux.
os: [windows-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Restore
run: dotnet restore EnterpriseChat.sln
- name: Format check
run: dotnet format EnterpriseChat.sln --verify-no-changes --no-restore
# RunSpaTypeCheck=true es obligatorio aquí: BuildVueSpa ejecuta `npx vite build`,
# y Vite transpila TypeScript SIN comprobar tipos. Sin este flag, un error de tipos
# en el SPA compila verde en local y en CI pese a tener `strict: true`.
- name: Build
run: dotnet build EnterpriseChat.sln --no-restore --configuration Release -p:RunSpaTypeCheck=true
- name: Test
run: dotnet test EnterpriseChat.sln --no-build --configuration Release --logger "trx;LogFileName=test-results.trx" --results-directory TestResults
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.os }}
path: TestResults
build-linux-server:
name: Build and test server on Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Restore server
run: dotnet restore src/EnterpriseChat.Server/EnterpriseChat.Server.csproj
- name: Build server (Release)
run: dotnet build src/EnterpriseChat.Server/EnterpriseChat.Server.csproj --no-restore --configuration Release
# El proyecto de tests es net8.0 y no referencia WPF, así que corre en Linux.
# systemd es una plataforma soportada: sin esto, todo el comportamiento Linux del
# servidor (rutas, WAL de SQLite, permisos de data/master.key) queda sin cobertura.
- name: Restore tests
run: dotnet restore tests/EnterpriseChat.Tests/EnterpriseChat.Tests.csproj
- name: Test (Release)
run: dotnet test tests/EnterpriseChat.Tests/EnterpriseChat.Tests.csproj --configuration Release --logger "trx;LogFileName=test-results-linux.trx" --results-directory TestResults
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-linux
path: TestResults