Skip to content

Commit c1dd357

Browse files
Ja bist du narrischJa bist du narrisch
authored andcommitted
added create user script to github actions
1 parent 4078d75 commit c1dd357

File tree

3 files changed

+48
-29
lines changed

3 files changed

+48
-29
lines changed

.github/workflows/dotnetpull.yml

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ name: .NET Pull Request
22

33
on:
44
pull_request:
5-
branches: [ master ]
5+
branches: [master]
66

77
jobs:
88
build:
9-
109
runs-on: ubuntu-latest
1110

1211
services:
@@ -67,29 +66,33 @@ jobs:
6766
--health-retries=10
6867
6968
steps:
70-
- uses: actions/checkout@v4
71-
- name: Setup .NET
72-
uses: actions/setup-dotnet@v4
73-
with:
74-
dotnet-version: |
75-
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: Create SQLServer database
85-
run: |
86-
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'YourStrong@Passw0rd' -Q "CREATE DATABASE [Whatever];"
87-
- name: Restore dependencies
88-
run: |
89-
dotnet restore Migrator.slnx
90-
- name: Build
91-
run: |
92-
dotnet build Migrator.slnx
93-
- name: Test
94-
run: |
95-
dotnet test Migrator.slnx
69+
- uses: actions/checkout@v4
70+
- uses: gvenzl/setup-oracle-sqlcl@v1
71+
- name: Setup .NET
72+
uses: actions/setup-dotnet@v4
73+
with:
74+
dotnet-version: |
75+
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: Create SQLServer database
85+
run: |
86+
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'YourStrong@Passw0rd' -Q "CREATE DATABASE [Whatever];"
87+
- name: Create Oracle user
88+
run: |
89+
sql test/test@localhost/FREEPDB1 @.github/workflows/sql/oracle.sql
90+
- name: Restore dependencies
91+
run: |
92+
dotnet restore Migrator.slnx
93+
- name: Build
94+
run: |
95+
dotnet build Migrator.slnx
96+
- name: Test
97+
run: |
98+
dotnet test Migrator.slnx

.github/workflows/sql/oracle.sql

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
alter session set container = freepdb1;
2+
create user k identified by k;
3+
grant
4+
create user
5+
to k;
6+
grant
7+
drop user
8+
to k;
9+
grant
10+
create session
11+
to k with admin option;
12+
grant resource to k with admin option;
13+
grant connect to k with admin option;
14+
grant
15+
unlimited tablespace
16+
to k with admin option;

src/Migrator.Tests/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
{
1616
"Id": "Oracle",
17-
"ConnectionString": "Data Source=//localhost:1521/FREEPDB1;User Id=test;Password=test;"
17+
"ConnectionString": "Data Source=//localhost:1521/FREEPDB1;User Id=k;Password=k;"
1818
},
1919
{
2020
"Id": "MySQL",

0 commit comments

Comments
 (0)