Skip to content

Commit 4078d75

Browse files
Ja bist du narrischJa bist du narrisch
authored andcommitted
Merge remote-tracking branch 'origin/master' into postgre-test-reactivation
2 parents fafa535 + 072de29 commit 4078d75

File tree

3 files changed

+89
-33
lines changed

3 files changed

+89
-33
lines changed

.github/workflows/dotnet.yml

Lines changed: 72 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,87 @@ jobs:
1111

1212
runs-on: ubuntu-latest
1313

14+
services:
15+
sqlserver:
16+
image: mcr.microsoft.com/mssql/server:2019-latest
17+
ports:
18+
- 1433:1433
19+
env:
20+
SA_PASSWORD: YourStrong@Passw0rd
21+
ACCEPT_EULA: Y
22+
options: >-
23+
--health-cmd "bash -c '</dev/tcp/localhost/1433' && exit 0 || exit 1"
24+
--health-interval=10s
25+
--health-timeout=5s
26+
--health-retries=10
27+
28+
postgres:
29+
image: postgres:13
30+
ports:
31+
- 5432:5432
32+
env:
33+
POSTGRES_USER: testuser
34+
POSTGRES_PASSWORD: testpass
35+
POSTGRES_DB: testdb
36+
options: >-
37+
--health-cmd="pg_isready -U testuser"
38+
--health-interval=10s
39+
--health-timeout=5s
40+
--health-retries=5
41+
42+
oracle:
43+
image: gvenzl/oracle-free:latest
44+
ports:
45+
- 1521:1521
46+
env:
47+
ORACLE_RANDOM_PASSWORD: true
48+
APP_USER: test
49+
APP_USER_PASSWORD: test
50+
options: >-
51+
--health-cmd healthcheck.sh
52+
--health-interval 10s
53+
--health-timeout 5s
54+
--health-retries 10
55+
56+
mysql:
57+
image: mysql:8.0
58+
ports:
59+
- 3306:3306
60+
env:
61+
MYSQL_ROOT_PASSWORD: rootpass
62+
MYSQL_DATABASE: testdb
63+
MYSQL_USER: testuser
64+
MYSQL_PASSWORD: testpass
65+
options: >-
66+
--health-cmd="mysqladmin ping -h localhost -u root -prootpass"
67+
--health-interval=10s
68+
--health-timeout=5s
69+
--health-retries=10
70+
1471
steps:
1572
- uses: actions/checkout@v4
16-
- name: Fetch history
17-
run: git fetch --prune --unshallow
1873
- name: Setup .NET
1974
uses: actions/setup-dotnet@v4
2075
with:
2176
dotnet-version: |
2277
9.0.x
78+
- name: Install SQLCMD tools
79+
run: |
80+
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
81+
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
82+
sudo apt-get update
83+
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools unixodbc-dev
84+
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
85+
source ~/.bashrc
86+
- name: Create SQLServer database
87+
run: |
88+
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'YourStrong@Passw0rd' -Q "CREATE DATABASE [Whatever];"
2389
- name: Restore dependencies
2490
run: |
2591
dotnet restore Migrator.slnx
26-
2792
- name: Build
2893
run: |
29-
dotnet build -c Release Migrator.slnx
94+
dotnet build Migrator.slnx
95+
- name: Test
96+
run: |
97+
dotnet test Migrator.slnx

.github/workflows/dotnetpull.yml

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,19 @@ jobs:
3737
--health-timeout=5s
3838
--health-retries=5
3939
40-
# oracle:
41-
# image: gvenzl/oracle-xe:21.3.0-slim
42-
# ports:
43-
# - 1521:1521
44-
# env:
45-
# ORACLE_PASSWORD: testpass
46-
# options: >-
47-
# --health-cmd "echo 'exit' | sqlplus -L system/oracle@localhost/XEPDB1"
48-
# --health-interval=25s
49-
# --health-timeout=20s
50-
# --health-retries=20
40+
oracle:
41+
image: gvenzl/oracle-free:latest
42+
ports:
43+
- 1521:1521
44+
env:
45+
ORACLE_RANDOM_PASSWORD: true
46+
APP_USER: test
47+
APP_USER_PASSWORD: test
48+
options: >-
49+
--health-cmd healthcheck.sh
50+
--health-interval 10s
51+
--health-timeout 5s
52+
--health-retries 10
5153
5254
mysql:
5355
image: mysql:8.0
@@ -79,20 +81,6 @@ jobs:
7981
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools unixodbc-dev
8082
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
8183
source ~/.bashrc
82-
# - name: Download and install Oracle SQLcl
83-
# run: |
84-
# curl -L -o sqlcl.zip https://download.oracle.com/otn_software/java/sqldeveloper/sqlcl-latest.zip
85-
# unzip sqlcl.zip -d sqlcl
86-
# echo "$PWD/sqlcl/sqlcl/bin" >> $GITHUB_PATH
87-
# - name: Run SQL script with Oracle SQLcl
88-
# run: |
89-
# echo "create user test identified by test;" > setup.sql
90-
# echo "grant connect, resource to test;" >> setup.sql
91-
# sql /nolog <<EOF
92-
# connect system/testpass@//localhost:1521/XEPDB1
93-
# @setup.sql
94-
# exit
95-
# EOF
9684
- name: Create SQLServer database
9785
run: |
9886
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'YourStrong@Passw0rd' -Q "CREATE DATABASE [Whatever];"

src/Migrator.Tests/appsettings.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
"Id": "PostgreSQL",
1313
"ConnectionString": "Server=localhost;Port=5432;Database=testdb;User Id=testuser;Password=testpass;"
1414
},
15-
//{
16-
// "Id": "Oracle",
17-
// "ConnectionString": "Data Source=//localhost:1521/XEPDB1;User Id=test;Password=test;"
18-
//},
15+
{
16+
"Id": "Oracle",
17+
"ConnectionString": "Data Source=//localhost:1521/FREEPDB1;User Id=test;Password=test;"
18+
},
1919
{
2020
"Id": "MySQL",
2121
"ConnectionString": "Server=127.0.0.1;Port=3306;Database=testdb;User Id=testuser;Password=testpass;"

0 commit comments

Comments
 (0)