Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: .NET

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Fetch history
run: git fetch --prune --unshallow
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.0.x
- name: Restore dependencies
run: |
dotnet restore Migrator.slnx
- name: Build
run: |
dotnet build -c Release Migrator.slnx
107 changes: 107 additions & 0 deletions .github/workflows/dotnetpull.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: .NET Pull Request

on:
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

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
POSTGRES_DB: testdb
options: >-
--health-cmd="pg_isready -U testuser"
--health-interval=10s
--health-timeout=5s
--health-retries=5
# oracle:
# image: gvenzl/oracle-xe:21.3.0-slim
# ports:
# - 1521:1521
# env:
# ORACLE_PASSWORD: testpass
# options: >-
# --health-cmd "echo 'exit' | sqlplus -L system/oracle@localhost/XEPDB1"
# --health-interval=25s
# --health-timeout=20s
# --health-retries=20

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
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.0.x
- name: Install SQLCMD tools
run: |
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools unixodbc-dev
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
source ~/.bashrc
# - name: Download and install Oracle SQLcl
# run: |
# curl -L -o sqlcl.zip https://download.oracle.com/otn_software/java/sqldeveloper/sqlcl-latest.zip
# unzip sqlcl.zip -d sqlcl
# echo "$PWD/sqlcl/sqlcl/bin" >> $GITHUB_PATH
# - name: Run SQL script with Oracle SQLcl
# run: |
# echo "create user test identified by test;" > setup.sql
# echo "grant connect, resource to test;" >> setup.sql
# sql /nolog <<EOF
# connect system/testpass@//localhost:1521/XEPDB1
# @setup.sql
# exit
# EOF
- name: Create SQLServer database
run: |
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P 'YourStrong@Passw0rd' -Q "CREATE DATABASE [Whatever];"
- name: Restore dependencies
run: |
dotnet restore Migrator.slnx
- name: Build
run: |
dotnet build Migrator.slnx
- name: Test
run: |
dotnet test Migrator.slnx
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: .NET

on:
release:
types: [published]

jobs:
build:
permissions: write-all
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Fetch history
run: git fetch --prune --unshallow
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.0.x
- name: Restore dependencies
run: |
dotnet restore Migrator.slnx
- name: Update project version
uses: roryprimrose/set-vs-sdk-project-version@v1
with:
version: ${{ github.event.release.tag_name }}
assemblyVersion: ${{ github.event.release.tag_name }}
fileVersion: ${{ github.event.release.tag_name }}
informationalVersion: ${{ github.event.release.tag_name }}-${{ github.sha }}

- name: Build
run: |
dotnet build -c Release Migrator.slnx
22 changes: 22 additions & 0 deletions Migrator.slnx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<Solution>
<Folder Name="/Core/">
<Project Path="src/Migrator/DotNetProjects.Migrator.csproj" />
</Folder>
<Folder Name="/Extras/">
<File Path="doc/README.txt" />
<File Path="doc/TODO.txt" />
<File Path="src/MigratorDotNet.snk" />
</Folder>
<Folder Name="/Extras/.github/" />
<Folder Name="/Extras/.github/workflows/">
<File Path=".github/workflows/dotnet.yml" />
<File Path=".github/workflows/dotnetpull.yml" />
<File Path=".github/workflows/release.yml" />
</Folder>
<Folder Name="/Solution Items/">
<File Path=".editorconfig" />
</Folder>
<Folder Name="/Tests/">
<Project Path="src/Migrator.Tests/Migrator.Tests.csproj" />
</Folder>
</Solution>
Loading
Loading