@@ -11,19 +11,99 @@ 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-xe:21.3.0-slim
44+ # ports:
45+ # - 1521:1521
46+ # env:
47+ # ORACLE_PASSWORD: testpass
48+ # options: >-
49+ # --health-cmd "echo 'exit' | sqlplus -L system/oracle@localhost/XEPDB1"
50+ # --health-interval=25s
51+ # --health-timeout=20s
52+ # --health-retries=20
53+
54+ mysql :
55+ image : mysql:8.0
56+ ports :
57+ - 3306:3306
58+ env :
59+ MYSQL_ROOT_PASSWORD : rootpass
60+ MYSQL_DATABASE : testdb
61+ MYSQL_USER : testuser
62+ MYSQL_PASSWORD : testpass
63+ options : >-
64+ --health-cmd="mysqladmin ping -h localhost -u root -prootpass"
65+ --health-interval=10s
66+ --health-timeout=5s
67+ --health-retries=10
68+
1469 steps :
1570 - uses : actions/checkout@v4
16- - name : Fetch history
17- run : git fetch --prune --unshallow
1871 - name : Setup .NET
1972 uses : actions/setup-dotnet@v4
2073 with :
2174 dotnet-version : |
2275 9.0.x
76+ - name : Install SQLCMD tools
77+ run : |
78+ curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
79+ curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
80+ sudo apt-get update
81+ sudo ACCEPT_EULA=Y apt-get install -y mssql-tools unixodbc-dev
82+ echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
83+ source ~/.bashrc
84+ # - name: Download and install Oracle SQLcl
85+ # run: |
86+ # curl -L -o sqlcl.zip https://download.oracle.com/otn_software/java/sqldeveloper/sqlcl-latest.zip
87+ # unzip sqlcl.zip -d sqlcl
88+ # echo "$PWD/sqlcl/sqlcl/bin" >> $GITHUB_PATH
89+ # - name: Run SQL script with Oracle SQLcl
90+ # run: |
91+ # echo "create user test identified by test;" > setup.sql
92+ # echo "grant connect, resource to test;" >> setup.sql
93+ # sql /nolog <<EOF
94+ # connect system/testpass@//localhost:1521/XEPDB1
95+ # @setup.sql
96+ # exit
97+ # EOF
98+ - name : Create SQLServer database
99+ run : |
100+ /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'YourStrong@Passw0rd' -Q "CREATE DATABASE [Whatever];"
23101 - name : Restore dependencies
24102 run : |
25103 dotnet restore Migrator.slnx
26-
27104 - name : Build
28105 run : |
29- dotnet build -c Release Migrator.slnx
106+ dotnet build Migrator.slnx
107+ - name : Test
108+ run : |
109+ dotnet test Migrator.slnx
0 commit comments