-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (69 loc) · 2.06 KB
/
build_and_test.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
name: Build and Test
on:
workflow_call:
push:
branches:
- main
- develop
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
permissions:
contents: read
jobs:
build_and_test_net:
name: Build and Test .Net App
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache .NET packages
uses: actions/cache@v3
id: dotnet-cache
with:
path: ~/.nuget/packages
key: dotnet-packages-${{ github.repository }}
restore-keys: dotnet-packages-${{ github.repository }}
- name: Setup .NET
uses: actions/setup-dotnet@v3
if: steps.dotnet-cache.outputs.cache-hit != 'true'
with:
dotnet-version: 8.0.x
- name: Build and Restore App
run: dotnet build ./HomeBrokerSPA/HomeBrokerSPA.csproj --restore
continue-on-error: false
- name: Test .Net App
run: |
dotnet tool install -g dotnet-reportgenerator-globaltool
dotnet test ./HomeBrokerXUnit/HomeBrokerXUnit.csproj
continue-on-error: false
build_and_test_angular:
needs: build_and_test_net
name: Build and Test Angular App
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Angular dependencies
run: |
cd HomeBrokerSPA/HomeBrokerChart
npm install npm@latest > /dev/null 2>&1
npm install -g @angular/cli > /dev/null 2>&1
npm install
continue-on-error: false
- name: Build Angular App
run: |
cd HomeBrokerSPA/HomeBrokerChart
npm run build
continue-on-error: false
- name: Test Angular App
run: |
cd HomeBrokerSPA/HomeBrokerChart
npm run test:coverage
continue-on-error: false
trigger_tests_sonarcloud:
needs: build_and_test_angular
name: Triggered Build and Test
uses: alexfariakof/Home_Broker_Chart/.github/workflows/test_analyse_in_Sonar_Cloud.yml@main
secrets: inherit