-
Notifications
You must be signed in to change notification settings - Fork 8
178 lines (154 loc) · 5.04 KB
/
on-dms-pullrequest.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
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# SPDX-License-Identifier: Apache-2.0
# Licensed to the Ed-Fi Alliance under one or more agreements.
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
# See the LICENSE and NOTICES files in the project root for more information.
name: On DMS Pull Request
on:
push:
# Running on push to main to support CodeQL on C#
branches:
- main
paths:
- "src/dms/**/*.cs"
- "src/dms/**/*.csproj"
- "src/dms/Directory.Packages.props"
pull_request:
branches:
- main
paths:
- "src/dms/**/*.cs"
- "src/dms/**/*.csproj"
- ".github/**/*dms*.yml"
- "src/dms/Directory.Packages.props"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions: read-all
jobs:
scan-actions-bidi:
name: Scan Actions, scan all files for BIDI Trojan Attacks
uses: Ed-Fi-Alliance-OSS/Ed-Fi-Actions/.github/workflows/repository-scanner.yml@main
with:
config-file-path: ./.github/workflows/bidi-config.json
run-unit-tests:
name: Run Unit Tests
runs-on: ubuntu-latest
defaults:
run:
shell: pwsh
steps:
- name: Checkout the Repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup dotnet
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3
with:
dotnet-version: '8.0.x'
- name: Build
run: ./build-dms.ps1 Build -Configuration Debug
- name: Install Coverlet Reference
if: success()
run: |
dotnet tool install --global coverlet.console
dotnet tool install --global dotnet-reportgenerator-globaltool
- name: Run Unit Tests
run: ./build-dms.ps1 UnitTest -Configuration Debug
- name: Generate Coverage Report
if: ${{ hashFiles('coverage.cobertura.xml') != '' }}
run: ./build-dms.ps1 Coverage
- name: Upload Coverage Report
if: always()
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: Coverage Report
path: coveragereport
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: Unit Test Results
overwrite: true
path: |
**/*.trx
run-integration-tests:
name: Run Integration Tests
runs-on: ubuntu-latest
defaults:
run:
shell: pwsh
services:
postgres:
image: postgres:16.3-alpine
options: >-
--health-cmd="pg_isready"
--health-interval=10s
--health-timeout=5s
--health-retries=5
ports:
- 5432:5432
env:
POSTGRES_HOST_AUTH_METHOD: trust
steps:
- name: Checkout the Repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup dotnet
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3
with:
dotnet-version: '8.0.x'
- name: Build
run: ./build-dms.ps1 Build -Configuration Debug
- name: Run Integration Tests
if: success()
run: ./build-dms.ps1 IntegrationTest -Configuration Debug
- name: Upload Integration Test Results
if: always()
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: Integration Test Results
overwrite: true
path: |
**/*.trx
run-e2e-tests:
name: Run E2E Tests
needs: run-unit-tests
runs-on: ubuntu-latest
defaults:
run:
shell: pwsh
steps:
- name: Checkout the Repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup dotnet
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3
with:
dotnet-version: '8.0.x'
- name: Run OpenSearch End to End Tests
if: success()
run: ./build-dms.ps1 E2ETest -EnableOpenSearch
- name: Upload Logs
if: failure()
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: test-logs
path: |
./src/services/EdFi.DataManagementService.Api.Tests.E2E/bin/Debug/net8.0/logs
retention-days: 10
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: E2E Test Results
overwrite: true
path: |
**/*.trx
event_file:
name: Upload Event File
runs-on: ubuntu-latest
needs: [run-unit-tests, run-e2e-tests, run-integration-tests]
if: always()
steps:
- name: Upload
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: Event File
path: ${{ github.event_path }}