forked from bittercoder/Migrator.NET
-
-
Notifications
You must be signed in to change notification settings - Fork 12
108 lines (106 loc) · 3.22 KB
/
dotnetpull.yml
File metadata and controls
108 lines (106 loc) · 3.22 KB
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
name: .NET Pull Request
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-22.04
services:
sqlserver:
image: mcr.microsoft.com/mssql/server:2019-latest
ports:
- 1433:1433
env:
SA_PASSWORD: YourStrong@Passw0rd
ACCEPT_EULA: Y
options: >-
--health-cmd "bash -c '</dev/tcp/localhost/1433' && exit 0 || exit 1"
--health-interval=10s
--health-timeout=5s
--health-retries=10
postgres:
image: postgres:13
ports:
- 5432:5432
env:
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testpass
# As of v16 we can use:
# POSTGRES_INITDB_ARGS: "-c max_connections=300"
options: >-
--health-cmd="pg_isready -U testuser"
--health-interval=10s
--health-timeout=5s
--health-retries=5
oracle:
image: gvenzl/oracle-free:latest
ports:
- 1521:1521
env:
ORACLE_PASSWORD: adfkweflajdfglkj
options: >-
--health-cmd healthcheck.sh
--health-interval 10s
--health-timeout 5s
--health-retries 10
mysql:
image: mysql:8.0
ports:
- 3306:3306
env:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: testdb
MYSQL_USER: testuser
MYSQL_PASSWORD: testpass
options: >-
--health-cmd="mysqladmin ping -h localhost -u root -prootpass"
--health-interval=10s
--health-timeout=5s
--health-retries=10
steps:
- uses: actions/checkout@v4
- uses: gvenzl/setup-oracle-sqlcl@v1
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.0.x
- name: Install Microsoft GPG apt-key
run: |
wget https://packages.microsoft.com/keys/microsoft.asc -O microsoft.asc
gpg --dearmor microsoft.asc
chmod 644 microsoft.asc.gpg
sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
- name: Add Microsoft SQL Server repo
run: |
echo "deb [arch=amd64] https://packages.microsoft.com/config/ubuntu/22.04/prod jammy main"
sudo apt-get update
- name: Install SQLCMD tools
run: |
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools unixodbc-dev
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc
- name: Create SQLServer database
run: |
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'YourStrong@Passw0rd' -Q "CREATE DATABASE [Whatever];"
- name: Create Oracle user
run: |
sql sys/adfkweflajdfglkj@localhost/FREEPDB1 as sysdba <<EOF
WHENEVER SQLERROR EXIT SQL.SQLCODE
SET ECHO ON
SET FEEDBACK ON
SET SERVEROUTPUT ON
@.github/workflows/sql/oracle.sql
EXIT;
EOF
- name: Restore dependencies
run: |
dotnet restore Migrator.slnx
- name: Build
run: |
dotnet build Migrator.slnx
- name: Test
run: |
dotnet test Migrator.slnx