|
| 1 | +name: .NET Core |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + db: |
| 7 | + strategy: |
| 8 | + fail-fast: false |
| 9 | + matrix: |
| 10 | + include: |
| 11 | + - DB: SqlServer2008 |
| 12 | + CONNECTION_STRING: "Server=localhost;initial catalog=nhibernate;User Id=sa;Password=P@ssw0rd;packet size=4096;" |
| 13 | + - DB: PostgreSQL |
| 14 | + CONNECTION_STRING: "Host=localhost;Username=nhibernate;Password=nhibernate;Database=nhibernate;Enlist=true;" |
| 15 | + - DB: Firebird |
| 16 | + CONNECTION_STRING: "DataSource=localhost;Database=nhibernate;User=SYSDBA;Password=nhibernate;charset=utf8;" |
| 17 | + - DB: MySQL |
| 18 | + CONNECTION_STRING: "Server=localhost;Uid=root;Password=nhibernate;Database=nhibernate;Old Guids=True;" |
| 19 | + ALLOW_FAILURE: true |
| 20 | + - DB: SQLite |
| 21 | + runs-on: ubuntu-latest |
| 22 | + continue-on-error: ${{matrix.ALLOW_FAILURE == true}} |
| 23 | + env: |
| 24 | + LANG: en-US.UTF-8 #default POSIX locale doesn't support ignore case comparisons |
| 25 | + name: ${{matrix.DB}} |
| 26 | + |
| 27 | + steps: |
| 28 | + - name: Set up SqlServer |
| 29 | + if: matrix.DB == 'SqlServer2008' |
| 30 | + run: | |
| 31 | + docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=P@ssw0rd" -e "MSSQL_PID=Express" -p 1433:1433 -d --name sqlexpress microsoft/mssql-server-linux:latest; |
| 32 | +
|
| 33 | + - name: Set up MySQL |
| 34 | + if: matrix.DB == 'MySQL' |
| 35 | + run: | |
| 36 | + sudo service mysql stop |
| 37 | + docker run --name mysql -e MYSQL_ROOT_PASSWORD=nhibernate -e MYSQL_USER=nhibernate -e MYSQL_PASSWORD=nhibernate -e MYSQL_DATABASE=nhibernate -p 3306:3306 --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 -d mysql:5.7 mysqld --lower_case_table_names=1 |
| 38 | +
|
| 39 | + - name: Set up PostgreSQL |
| 40 | + if: matrix.DB == 'PostgreSQL' |
| 41 | + run: | |
| 42 | + docker run -d -e POSTGRES_USER=nhibernate -e POSTGRES_PASSWORD=nhibernate -e POSTGRES_DB=nhibernate -p 5432:5432 postgres:13 |
| 43 | +
|
| 44 | + - name: Set up Firebird |
| 45 | + if: matrix.DB == 'Firebird' |
| 46 | + run: | |
| 47 | + docker run --name firebird -e EnableWireCrypt=true -e FIREBIRD_USER=nhibernate -e FIREBIRD_PASSWORD=nhibernate -e ISC_PASSWORD=nhibernate -e FIREBIRD_DATABASE=nhibernate -p 3050:3050 -d jacobalberty/firebird:v3.0 |
| 48 | +
|
| 49 | + - uses: actions/checkout@v2 |
| 50 | + - name: Setup .NET |
| 51 | + uses: actions/setup-dotnet@v1.8.0 |
| 52 | + with: |
| 53 | + dotnet-version: 2.1.x |
| 54 | + |
| 55 | + - name: Build and Test |
| 56 | + run: | |
| 57 | + pwsh -noprofile -command "& ./build.ps1 -TaskList Set-Configuration,Test -properties @{'Database' = '${{matrix.DB}}';'ConnectionString'='${{matrix.CONNECTION_STRING}}'}" |
0 commit comments