-
Notifications
You must be signed in to change notification settings - Fork 7
88 lines (69 loc) · 1.98 KB
/
BuildAndTests.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: MR build and tests
on:
pull_request:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build backend application
run: dotnet build --configuration Debug --no-restore
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Install dependencies
run: npm install
working-directory: ./easyfinance.client
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: build
path: .
unit-tests:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: build
path: .
- uses: actions/checkout@v4
- name: Run .Net tests
run: dotnet test --verbosity normal --no-build
- name: Run Angular tests
id: angular
run: npm test -- --watch=false --browsers=ChromeHeadless
working-directory: ./easyfinance.client
integration-tests:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: build
path: .
- name: Start application
id: dotnet
run: dotnet run --project ./EasyFinance.Server --no-build --urls https://localhost:7003/ &
- name: Run Cypress tests
id: cypress
run: npx cypress run
working-directory: ./easyfinance.client
- name: Archive Cypress errors
if: failure()
uses: actions/upload-artifact@v4
with:
name: cypress-screenshots
path: ./easyfinance.client/cypress/screenshots