Skip to content

Commit d6e642f

Browse files
committed
NH-3807 - Develop AppVeyor and CircleCI builds.
- Allow failure for MySQL. - Include TestLoggers. - Exclude committed directories to Tools folder from being deleted.
1 parent fb0776a commit d6e642f

File tree

12 files changed

+863
-1
lines changed

12 files changed

+863
-1
lines changed

.circleci/config.yml

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
# CircleCI 2.0 configuration file
2+
---
3+
# Common primary image
4+
ref-base-image: &ref-base-image
5+
image: ngbrown/nhibernate-build-dotnet-sdk:latest
6+
environment:
7+
- DOTNET_CLI_TELEMETRY_OPTOUT: 1
8+
- CAKE_VERSION: 0.21.1
9+
10+
# Download and cache dependencies
11+
ref-restore-cache: &ref-restore-cache
12+
restore_cache:
13+
keys:
14+
- cake-{{ .Environment.CAKE_VERSION }}
15+
16+
ref-save-cache: &ref-save-cache
17+
save_cache:
18+
key: cake-{{ .Environment.CAKE_VERSION }}
19+
paths:
20+
- ~/project/tools
21+
22+
version: 2
23+
jobs:
24+
test-mssql:
25+
docker:
26+
- *ref-base-image
27+
28+
- image: microsoft/mssql-server-linux:latest
29+
environment:
30+
- ACCEPT_EULA: Y
31+
- SA_PASSWORD: Password12!
32+
33+
working_directory: ~/project
34+
35+
steps:
36+
- checkout
37+
38+
# Download and cache dependencies
39+
- *ref-restore-cache
40+
- run: ./build.sh --target Restore
41+
- *ref-save-cache
42+
43+
# compile and run tests.
44+
- run:
45+
name: Test on Microsoft SQL Server 2017 for Linux
46+
environment:
47+
- NHIBERNATE_DATABASE_TEMPLATE: MSSQL.cfg.xml
48+
- NHIBERNATE_CONNECTION_STRING: Server=(local);Database=master;User ID=sa;Password=Password12!
49+
- NHIBERNATE_DIALECT: NHibernate.Dialect.MsSql2012Dialect
50+
- DOTNET_FRAMEWORK: netcoreapp2.0
51+
- TARGET_PLATFORM: x64
52+
command: ./build.sh --target CircleCI --configuration Debug
53+
54+
- store_test_results:
55+
path: ~/test-reports
56+
- store_artifacts:
57+
path: ~/test-reports
58+
59+
test-postgresql:
60+
docker:
61+
- *ref-base-image
62+
63+
- image: postgres:9.6-alpine
64+
environment:
65+
- POSTGRES_PASSWORD: Password12!
66+
command: ["postgres", "-c", "max_prepared_transactions=100"]
67+
68+
working_directory: ~/project
69+
70+
steps:
71+
- checkout
72+
73+
# Download and cache dependencies
74+
- *ref-restore-cache
75+
- run: ./build.sh --target Restore
76+
- *ref-save-cache
77+
78+
# compile and run tests.
79+
- run:
80+
name: Test on PostgreSQL 9.6 for Linux
81+
environment:
82+
- NHIBERNATE_DATABASE_TEMPLATE: PostgreSQL.cfg.xml
83+
- NHIBERNATE_CONNECTION_STRING: Server=localhost;Port=5432;Database=nhibernate;User ID=postgres;Password=Password12!;Enlist=true;
84+
- NHIBERNATE_DIALECT: NHibernate.Dialect.PostgreSQL83Dialect
85+
- DOTNET_FRAMEWORK: netcoreapp2.0
86+
- TARGET_PLATFORM: x64
87+
command: ./build.sh --target CircleCI --configuration Debug
88+
89+
- store_test_results:
90+
path: ~/test-reports
91+
- store_artifacts:
92+
path: ~/test-reports
93+
94+
test-firebird:
95+
docker:
96+
- *ref-base-image
97+
98+
- image: jacobalberty/firebird:2.5.7-ss
99+
environment:
100+
- ISC_PASSWORD: Password12!
101+
FIREBIRD_USER: nhibernate
102+
FIREBIRD_PASSWORD: Password12!
103+
FIREBIRD_DATABASE: nhibernate
104+
105+
working_directory: ~/project
106+
107+
steps:
108+
- checkout
109+
110+
# Download and cache dependencies
111+
- *ref-restore-cache
112+
- run: ./build.sh --target Restore
113+
- *ref-save-cache
114+
115+
# compile and run tests.
116+
- run:
117+
name: Test on Firebird 3.0 for Linux
118+
environment:
119+
- NHIBERNATE_DATABASE_TEMPLATE: FireBird.cfg.xml
120+
- NHIBERNATE_CONNECTION_STRING: DataSource=localhost;Database=nhibernate;User ID=SYSDBA;Password=Password12!;MaxPoolSize=200;
121+
- NHIBERNATE_DIALECT: NHibernate.Dialect.FirebirdDialect
122+
- DOTNET_FRAMEWORK: netcoreapp2.0
123+
- TARGET_PLATFORM: x64
124+
command: ./build.sh --target CircleCI --configuration Debug
125+
126+
- store_test_results:
127+
path: ~/test-reports
128+
- store_artifacts:
129+
path: ~/test-reports
130+
131+
workflows:
132+
version: 2
133+
build:
134+
jobs:
135+
- test-mssql
136+
- test-postgresql
137+
- test-firebird
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
FROM buildpack-deps:jessie-scm
2+
3+
RUN apt-get update \
4+
&& apt-get install -y --no-install-recommends \
5+
curl \
6+
unzip \
7+
libc6 \
8+
libcurl3 \
9+
libgcc1 \
10+
libgssapi-krb5-2 \
11+
libicu52 \
12+
liblttng-ust0 \
13+
libssl1.0.0 \
14+
libstdc++6 \
15+
libunwind8 \
16+
libuuid1 \
17+
zlib1g \
18+
&& rm -rf /var/lib/apt/lists/*
19+
20+
# Install .NET Core runtime - https://github.com/dotnet/dotnet-docker/blob/master/1.0/runtime/jessie/Dockerfile
21+
ENV DOTNET_VERSION 1.0.5
22+
ENV DOTNET_DOWNLOAD_SHA 55481b0254a72d8c342ba6ccca3908ffb5c99d7eeb54f83dec6cc93c6b4cc3ae
23+
ENV DOTNET_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/Runtime/$DOTNET_VERSION/dotnet-debian-x64.$DOTNET_VERSION.tar.gz
24+
25+
RUN curl -SL $DOTNET_DOWNLOAD_URL --output dotnet.tar.gz \
26+
&& echo "$DOTNET_DOWNLOAD_SHA dotnet.tar.gz" | sha256sum -c - \
27+
&& mkdir -p /usr/share/dotnet \
28+
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
29+
&& rm dotnet.tar.gz
30+
31+
# Install .NET Core SDK - https://github.com/dotnet/dotnet-docker/blob/master/2.0/sdk/jessie/amd64/Dockerfile
32+
ENV DOTNET_SDK_VERSION 2.0.0
33+
ENV DOTNET_SDK_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz
34+
ENV DOTNET_SDK_DOWNLOAD_SHA E457F3A5685382F7F24851A2E76EDBE75B575948C8A7F43220F159BA29C329A5008BBE7220C18DFB31EAF0398FC72177B1948B65E19B34ED0D907EFB459CF4B0
35+
36+
RUN curl -SL $DOTNET_SDK_DOWNLOAD_URL --output dotnet.tar.gz \
37+
&& echo "$DOTNET_SDK_DOWNLOAD_SHA dotnet.tar.gz" | sha512sum -c - \
38+
&& mkdir -p /usr/share/dotnet \
39+
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
40+
&& rm dotnet.tar.gz \
41+
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
42+
43+
# Trigger the population of the local package cache
44+
ENV NUGET_XMLDOC_MODE skip
45+
RUN mkdir warmup \
46+
&& cd warmup \
47+
&& dotnet new \
48+
&& cd .. \
49+
&& rm -rf warmup \
50+
&& rm -rf /tmp/NuGetScratch

Tools/.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
nuget.exe
22
NUnit.*
3-
vswhere.*
3+
vswhere/
4+
packages.config.md5sum
5+
Cake/
6+
Appveyor.TestLogger/

Tools/packages.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
<package id="NUnit.Extension.NUnitV2ResultWriter" version="3.5.0" targetFramework="net461" />
88
<package id="NUnit.Extension.TeamCityEventListener" version="1.0.2" targetFramework="net461" />
99
<package id="NUnit.Extension.VSProjectLoader" version="3.5.0" targetFramework="net461" />
10+
<package id="Cake" version="0.21.1" />
1011
</packages>

appveyor.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
version: "{build}"
2+
3+
# Skipping commits affecting specific files (GitHub only).
4+
skip_commits:
5+
files:
6+
- doc/*
7+
8+
# Build worker image (VM template)
9+
image: Visual Studio 2017
10+
11+
# scripts that are called at very beginning, before repo cloning
12+
init:
13+
- cmd: |-
14+
echo %APPVEYOR_BUILD_VERSION%
15+
echo %NHIBERNATE_DATABASE_TEMPLATE%
16+
echo %DOTNET_FRAMEWORK%
17+
18+
# fetch repository as zip archive
19+
#shallow_clone: true # default is "false"
20+
21+
# set clone depth
22+
clone_depth: 5 # clone entire repository history if not defined
23+
24+
environment:
25+
global:
26+
# Set the DOTNET_SKIP_FIRST_TIME_EXPERIENCE environment variable to stop wasting time caching packages
27+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
28+
# Don't report back to the mothership
29+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
30+
matrix:
31+
- JOB_NAME: MSSQL x64 .Net 4.6.1
32+
NHIBERNATE_DATABASE_TEMPLATE: MSSQL.cfg.xml
33+
NHIBERNATE_CONNECTION_STRING: Server=(local)\SQL2014;Database=master;User ID=sa;Password=Password12!
34+
NHIBERNATE_DIALECT: NHibernate.Dialect.MsSql2012Dialect
35+
DOTNET_FRAMEWORK: net461
36+
TARGET_PLATFORM: x64
37+
38+
- JOB_NAME: MSSQL x64 .NET Core 2.0
39+
NHIBERNATE_DATABASE_TEMPLATE: MSSQL.cfg.xml
40+
NHIBERNATE_CONNECTION_STRING: Server=(local)\SQL2014;Database=master;User ID=sa;Password=Password12!
41+
NHIBERNATE_DIALECT: NHibernate.Dialect.MsSql2012Dialect
42+
DOTNET_FRAMEWORK: netcoreapp2.0
43+
TARGET_PLATFORM: x64
44+
45+
- JOB_NAME: MySQL x64 .NET Core 2.0
46+
NHIBERNATE_DATABASE_TEMPLATE: MySql.cfg.xml
47+
NHIBERNATE_CONNECTION_STRING: Database=nhibernate;Server=localhost;Port=3306;User Id=root;Password=Password12!;
48+
NHIBERNATE_DIALECT: NHibernate.Dialect.MySQL55InnoDBDialect
49+
DOTNET_FRAMEWORK: netcoreapp2.0
50+
TARGET_PLATFORM: x64
51+
52+
- JOB_NAME: PostgreSQL x64 .NET Core 2.0
53+
NHIBERNATE_DATABASE_TEMPLATE: PostgreSQL.cfg.xml
54+
NHIBERNATE_CONNECTION_STRING: Server=localhost;Port=5432;Database=nhibernate;User ID=postgres;Password=Password12!;Enlist=true;
55+
NHIBERNATE_DIALECT: NHibernate.Dialect.PostgreSQL83Dialect
56+
DOTNET_FRAMEWORK: netcoreapp2.0
57+
TARGET_PLATFORM: x64
58+
59+
# this is how to allow failing jobs in the matrix
60+
matrix:
61+
allow_failures:
62+
- NHIBERNATE_DATABASE_TEMPLATE: MySql.cfg.xml
63+
DOTNET_FRAMEWORK: netcoreapp2.0
64+
65+
# build cache to preserve files/folders between builds
66+
cache:
67+
# - '%LocalAppData%\NuGet\v3-cache' # NuGet v3.x http-cache
68+
# - '%USERPROFILE%\.nuget\packages -> **\*.csproj' # global-packages cache
69+
70+
# scripts that run after cloning repository
71+
install:
72+
- ps: |-
73+
Invoke-WebRequest 'https://dotnetcli.blob.core.windows.net/dotnet/Sdk/2.0.0/dotnet-sdk-2.0.0-win-x64.exe' -OutFile "$env:appveyor_build_folder/dotnet-sdk-win-x64.exe"
74+
& "$env:appveyor_build_folder/dotnet-sdk-win-x64.exe" /install /quiet /norestart
75+
- echo max_prepared_transactions = 100 >> "C:\Program Files\PostgreSQL\9.6\data\postgresql.conf"
76+
77+
# enable service required for build/tests
78+
services:
79+
- mssql2014 # start SQL Server 2014 Express
80+
- mysql # start MySQL 5.6 service
81+
- postgresql96 # start PostgreSQL 9.6 service
82+
83+
nuget:
84+
disable_publish_on_pr: true
85+
86+
platform: Any CPU
87+
configuration: Release
88+
89+
# scripts to run before build
90+
before_build:
91+
- ps: |-
92+
$env:MYSQL_PWD="Password12!"
93+
& "C:\Program Files\MySQL\MySQL Server 5.7\bin\mysql" -e "create database nhibernate;" --user=root
94+
95+
build_script:
96+
- ps: .\build.ps1 -Target "Appveyor" -configuration Debug
97+
98+
# Run tests as part of build script instead of automatic tests
99+
test: off
100+
101+
artifacts:
102+
- path: '**\Release\*.nupkg'

0 commit comments

Comments
 (0)