-
Notifications
You must be signed in to change notification settings - Fork 11
94 lines (77 loc) · 2.71 KB
/
Copy pathtest-pr.yml
File metadata and controls
94 lines (77 loc) · 2.71 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
name: UnitTest-Checks
on:
pull_request:
types: [opened, reopened, synchronize, closed]
branches-ignore:
- 'test'
- 'master'
workflow_dispatch:
jobs:
test-frontend:
defaults:
run:
working-directory: ./prime-angular-frontend
if: github.ref != 'develop' || (github.ref == 'develop' && github.event.pull_request.merged == true)
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v1
- name: set-date
run: |
echo "GIT_COMMITTED_AT=$(date +%s)" >> ${GITHUB_ENV}
# - name: Cache node modules.
# uses: actions/cache@v2
# with:
# path: ~/.npm
# key: ${{ runner.os }}-node-${{ hashFiles('**/prime-angular-frontend/yarn.lock') }}
# restore-keys: |
# ${{ runner.os }}-node-
- name: Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
cache-dependency-path: prime-angular-frontend/yarn.lock
- name: install yarn
run: npm install -g yarn
- name: yarn and yarn run test
run: |
yarn
yarn run test
test-backend:
defaults:
run:
working-directory: ./prime-dotnet-webapi-tests
if: github.ref != 'develop' || (github.ref == 'develop' && github.event.pull_request.merged == true)
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: ['8.0']
steps:
- uses: actions/checkout@v2
- name: set-date
run: |
echo "GIT_COMMITTED_AT=$(date +%s)" >> ${GITHUB_ENV}
- name: Setup .NET Core 8.0
uses: actions/setup-dotnet@v1
with:
# Semantic version range syntax or exact version of a dotnet version
dotnet-version: '8.0'
- name: Install dependencies
run: |
cd ../
dotnet restore
- name: Install ReportGenerator
run: |
cd ../
dotnet tool install -g dotnet-reportgenerator-globaltool --version 5.3.6
- name: Generate coverage report
env:
EXCLUDE: "**/Migrations/**%2c**/Models/**%2c**/Views/**%2c**/ViewModels/**%2c**/Configuration/**%2c**/DTOs/**%2c**/Helpers/**%2c**/Resources/**%2c**/**Definitions.cs"
run: |
dotnet test /p:ExcludeByFile=$EXCLUDE /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:Exclude=[xunit.*]* --filter FullyQualifiedName\!~Integration
- name: Run report generator
run: |
reportgenerator "-reports:coverage.cobertura.xml" "-targetdir:coverage" -reporttype:lcov "-filefilters:-ApiDbContextModelSnapshot.cs;" -verbosity:Error