-
Notifications
You must be signed in to change notification settings - Fork 4
152 lines (130 loc) · 5.17 KB
/
build.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
# 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: .NET Build
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
env:
CONFIGURATION: "Release"
GA_USE_GITHUB_ENV: "true"
USE_MSSQL_DEFAULT_CONN_STRING: "FALSE"
USE_POSTGRES_DEFAULT_CONN_STRING: "FALSE"
SQLSERVER_SERVER: "localhost"
SQLSERVER_ADMIN_USER: "sa"
SQLSERVER_ADMIN_PASS: ${{ secrets.MSSQL_SA_PWD }}
SQLSERVER_DATABASE_DS2: "AnalyticsMiddleTier_Testing_Ds2"
SQLSERVER_DATABASE_DS31: "AnalyticsMiddleTier_Testing_Ds31"
SQLSERVER_DATABASE_DS32: "AnalyticsMiddleTier_Testing_Ds32"
SQLSERVER_DATABASE_DS33: "AnalyticsMiddleTier_Testing_Ds33"
SQLSERVER_DATABASE_DS40: "AnalyticsMiddleTier_Testing_Ds40"
SQLSERVER_INTEGRATED_SECURITY: "false"
SQLSERVER_USER: "sa"
SQLSERVER_PASS: ${{ secrets.MSSQL_PWD }}
POSTGRES_HOST: "localhost"
POSTGRES_DATABASE_DS32: "edfi_ods_tests_ds32"
POSTGRES_DATABASE_DS33: "edfi_ods_tests_ds33"
POSTGRES_DATABASE_DS40: "edfi_ods_tests_ds40"
POSTGRES_PORT: "5432"
POSTGRES_USER: "postgres"
POSTGRES_PASS: ${{ secrets.POSTGRESQL_PWD }}
POSTGRES_POOLING: "false"
jobs:
AMT-Build-Unit-Tests:
runs-on: Ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Assign release version from .version to Env variable
run: |
cat .version >> $GITHUB_ENV
- name: Caching packages
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 #v3.3.2
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Setup .NET
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a #v3.0.3
with:
dotnet-version: '8.0.x'
- name: Building AMT
run: |
.\build.ps1 build -Configuration ${{ env.CONFIGURATION }} -Version ${{ env.BUILD_VERSION }} -BuildCounter ${{ github.run_number }}
shell: pwsh
- name: Unit Tests
run: |
.\build.ps1 unittest -Configuration ${{ env.CONFIGURATION }}
shell: pwsh
AMT-Integration-Tests:
needs: AMT-Build-Unit-Tests
runs-on: Ubuntu-latest
# Service containers to run with `AMT-runner-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres:13
# Provide the password for postgres
env:
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASS }}
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Assign release version from .version to Env variable
run: |
cat .version >> $GITHUB_ENV
- name: Caching packages
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 #v3.3.2
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Setup .NET
uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a # v3.0.3
with:
dotnet-version: '8.0.x'
- name: Start Ubuntu container for SQLServer 2019 Express
run: |
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=${{ env.SQLSERVER_ADMIN_PASS }}" -e "MSSQL_PID=Express" -p 1433:1433 -d mcr.microsoft.com/mssql/server:2019-latest
- name: Create Postgres DB DS v3.2
run: |
.\eng\CreateTestDbAndSchema.ps1 -port ${{ env.POSTGRES_PORT }} -d ${{ env.POSTGRES_DATABASE_DS32 }} -ds 3.2
shell: pwsh
env:
PGPASSWORD: ${{ env.POSTGRES_PASS }}
- name: Create Postgres DB DS v3.3
run: |
.\eng\CreateTestDbAndSchema.ps1 -port ${{ env.POSTGRES_PORT }} -d ${{ env.POSTGRES_DATABASE_DS33 }} -ds 3.3
shell: pwsh
env:
PGPASSWORD: ${{ env.POSTGRES_PASS }}
- name: Create Postgres DB DS v4.0
run: |
.\eng\CreateTestDbAndSchema.ps1 -port ${{ env.POSTGRES_PORT }} -d ${{ env.POSTGRES_DATABASE_DS40 }} -ds 4.0
shell: pwsh
env:
PGPASSWORD: ${{ env.POSTGRES_PASS }}
- name: Building AMT
run: |
.\build.ps1 build -Configuration ${{ env.CONFIGURATION }} -Version ${{ env.BUILD_VERSION }} -BuildCounter ${{ github.run_number }}
shell: pwsh
- name: Integration Tests
run: |
.\build.ps1 integrationtest -Configuration ${{ env.CONFIGURATION }}
shell: pwsh