-
Notifications
You must be signed in to change notification settings - Fork 31
144 lines (119 loc) · 3.74 KB
/
ci.yml
File metadata and controls
144 lines (119 loc) · 3.74 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: "CI"
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
NODE_VERSION: 24.14.0
jobs:
test-backend:
name: "Backend"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: "10.x"
dotnet-quality: "ga"
cache: true
cache-dependency-path: "**/packages.lock.json"
- name: Build .NET solution
run: >
dotnet build Charts.sln
--configuration Release
--property:ContinuousIntegrationBuild=true
-warnAsError
- name: Verify .NET formatting
run: dotnet format Charts.sln --verify-no-changes
- name: Run backend tests with coverage
run: |
dotnet tool restore
dotnet test Charts.sln \
--collect:"XPlat Code Coverage" \
--results-directory:./server/coverage \
--logger:trx \
--configuration Release \
--property:ContinuousIntegrationBuild=true \
-warnAsError
- name: Convert coverage to lcov format
run: |
dotnet tool run reportgenerator \
-reports:"server/coverage/**/coverage.cobertura.xml" \
-targetdir:"server/coverage" \
-reporttypes:"lcov"
- name: Upload backend coverage to Codecov
if: always()
uses: codecov/codecov-action@v5
with:
files: ./server/coverage/lcov.info
flags: backend
name: backend-coverage
fail_ci_if_error: false
- name: Publish backend test results
uses: dorny/test-reporter@v2
if: success() || failure()
with:
name: xUnit Tests
path: server/coverage/*.trx
reporter: dotnet-trx
- name: Upload backend coverage artifacts
if: github.event_name == 'pull_request' && (success() || failure())
uses: actions/upload-artifact@v6
with:
name: backend-coverage-report
path: |
server/coverage/*.trx
server/coverage/lcov.info
test-website:
name: "Website"
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
cache-dependency-path: pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Check web formatting
run: pnpm run format:web:check
- name: Lint
run: pnpm --filter @stock-charts/client run lint
- name: Lint CSS
run: pnpm run lint:css
- name: Run unit tests
run: pnpm --filter @stock-charts/client run test:coverage
- name: Upload frontend coverage to Codecov
if: always()
uses: codecov/codecov-action@v5
with:
files: ./client/coverage/lcov.info
flags: frontend
name: frontend-coverage
fail_ci_if_error: false
- name: Upload coverage artifacts
if: github.event_name == 'pull_request' && always()
uses: actions/upload-artifact@v6
with:
name: code-coverage-reports
path: |
client/coverage/
server/coverage/lcov.info
server/coverage/*.trx
- name: Build site
run: pnpm --filter @stock-charts/client run build.prod