-
Notifications
You must be signed in to change notification settings - Fork 12
201 lines (166 loc) · 7.59 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
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the develop-v5.2 branch
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
XUNIT_RUNNER: "2.4.1"
CONFIGURATION: "Debug"
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build-postgres"
build-postgres:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Service containers to run with `runner-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: flexberry/alt.p8-postgresql-postgis
# Provide the password for postgres
env:
POSTGRES_PASSWORD: p@ssw0rd
# 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
env:
ConnectionStringPostgres: "SERVER=localhost;User ID=postgres;Password=p@ssw0rd;Port=5432;"
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v2
# Several .NET Core versions will be used during the test run.
# The lowest version gets installed first in order to prevent
# "a newer version is already installed" install errors.
- name: Install .NET Core 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
# Building requires an up-to-date .NET SDK.
- name: Install .NET 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
# Building requires an up-to-date .NET SDK.
- name: Install .NET 7.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
- name: Restore NewPlatform.Flexberry.ORM.ODataService.sln
run: dotnet restore NewPlatform.Flexberry.ORM.ODataService.sln
- name: Install xunit.runner.console
run: nuget install xunit.runner.console -Version $XUNIT_RUNNER -OutputDirectory testrunner
- name: Compile code
run: dotnet build --no-restore -v q /p:WarningLevel=0 -c $CONFIGURATION NewPlatform.Flexberry.ORM.ODataService.sln
- name: Test on dotnet 3.1
run: dotnet test ./Tests/NewPlatform.Flexberry.ORM.ODataService.Tests/bin/$CONFIGURATION/netcoreapp3.1/NewPlatform.Flexberry.ORM.ODataService.Tests.dll
- name: Test on dotnet 6.0
run: dotnet test ./Tests/NewPlatform.Flexberry.ORM.ODataService.Tests/bin/$CONFIGURATION/net6.0/NewPlatform.Flexberry.ORM.ODataService.Tests.dll
- name: Test on dotnet 7.0
run: dotnet test ./Tests/NewPlatform.Flexberry.ORM.ODataService.Tests/bin/$CONFIGURATION/net7.0/NewPlatform.Flexberry.ORM.ODataService.Tests.dll
- name: Test under mono
run: mono ./testrunner/xunit.runner.console.$XUNIT_RUNNER/tools/net461/xunit.console.exe ./Tests/NewPlatform.Flexberry.ORM.ODataService.Tests/bin/$CONFIGURATION/net461/NewPlatform.Flexberry.ORM.ODataService.Tests.dll
- name: Cleanup
if: always()
run: |
rm -Rf .ssh .github *
# This workflow contains a single job called "build-mssql"
build-mssql:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Service containers to run with `runner-job`
services:
# Label used to access the service container
mssql:
# Docker Hub image
image: mcr.microsoft.com/mssql/server:2019-latest
# Provide the password for mssql
env:
ACCEPT_EULA: Y
SA_PASSWORD: p@ssw0rd
# Set health checks to wait until mssql has started
options: >-
--health-cmd "/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P ${SA_PASSWORD} -Q 'SELECT 1' -b -o /dev/null"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 1433 on service container to the host
- 1433:1433
env:
ConnectionStringMssql: "SERVER=localhost;User ID=sa;Password=p@ssw0rd;"
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout repository
uses: actions/checkout@v2
# Several .NET Core versions will be used during the test run.
# The lowest version gets installed first in order to prevent
# "a newer version is already installed" install errors.
- name: Install .NET Core 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
# Building requires an up-to-date .NET SDK.
- name: Install .NET 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Install .NET 7.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 7.0.x
- name: Restore NewPlatform.Flexberry.ORM.ODataService.sln
run: dotnet restore NewPlatform.Flexberry.ORM.ODataService.sln
- name: Install xunit.runner.console
run: nuget install xunit.runner.console -Version $XUNIT_RUNNER -OutputDirectory testrunner
- name: Compile code
run: dotnet build --no-restore -v q /p:WarningLevel=0 -c $CONFIGURATION NewPlatform.Flexberry.ORM.ODataService.sln
- name: Test on dotnet 3.1
run: dotnet test ./Tests/NewPlatform.Flexberry.ORM.ODataService.Tests/bin/$CONFIGURATION/netcoreapp3.1/NewPlatform.Flexberry.ORM.ODataService.Tests.dll
- name: Test on dotnet 6.0
run: dotnet test ./Tests/NewPlatform.Flexberry.ORM.ODataService.Tests/bin/$CONFIGURATION/net6.0/NewPlatform.Flexberry.ORM.ODataService.Tests.dll
- name: Test on dotnet 7.0
run: dotnet test ./Tests/NewPlatform.Flexberry.ORM.ODataService.Tests/bin/$CONFIGURATION/net7.0/NewPlatform.Flexberry.ORM.ODataService.Tests.dll
- name: Test under mono
run: mono ./testrunner/xunit.runner.console.$XUNIT_RUNNER/tools/net461/xunit.console.exe ./Tests/NewPlatform.Flexberry.ORM.ODataService.Tests/bin/$CONFIGURATION/net461/NewPlatform.Flexberry.ORM.ODataService.Tests.dll
- name: Cleanup
if: always()
run: |
rm -Rf .ssh .github *
# This workflow contains a single job called "doxygen"
doxygen:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Requiring dependent jobs to be successful
needs: [build-postgres, build-mssql]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Install apt-get packages
run: sudo apt-get install -y doxygen
- name: Update documentation
run: |
[ $GITHUB_EVENT_NAME == 'push' ] &&
( [ $GITHUB_REF == "refs/heads/master" ] || [ $GITHUB_REF == "refs/heads/develop" ] ) &&
bash Doxygen/update-autodoc.sh
exit 0
- name: Cleanup
if: always()
run: |
rm -Rf .ssh .github *