-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (54 loc) · 1.94 KB
/
dotnet.yml
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
# This workflow will build and test a .NET project
name: .NET
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
backend-build-and-test:
name: Build and Test Backend
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore Backend Dependencies
run: dotnet restore CollectifyAPI/CollectifyAPI/CollectifyAPI.csproj
- name: Build Backend
run: dotnet build CollectifyAPI/CollectifyAPI/CollectifyAPI.csproj --no-restore
- name: Run Backend Tests
run: dotnet test CollectifyAPI/CollectifyAPI/CollectifyAPI.csproj --no-build --verbosity normal
- name: Clean Test Project
run: dotnet clean CollectifyAPI/CollectifyAPI.Tests/CollectifyAPI.Tests.csproj
- name: Restore Test Dependencies
run: dotnet restore CollectifyAPI/CollectifyAPI.Tests/CollectifyAPI.Tests.csproj
- name: Build Test Project
run: dotnet build CollectifyAPI/CollectifyAPI.Tests/CollectifyAPI.Tests.csproj --no-restore
- name: Run Unit and Integration Tests
run: dotnet test CollectifyAPI/CollectifyAPI.Tests/CollectifyAPI.Tests.csproj --no-build --verbosity detailed --logger "trx;LogFileName=TestResults.trx"
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: TestResults.trx
performance-tests:
name: Run Performance Tests
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Install k6
run: |
sudo apt update
sudo snap install k6
- name: Run k6 Performance Tests
run: k6 run CollectifyAPI/CollectifyAPI.Tests/PerformanceTests/test.js