diff --git a/.github/workflows/NetCoreTests.yml b/.github/workflows/NetCoreTests.yml new file mode 100644 index 00000000000..dd9d5ba2d2f --- /dev/null +++ b/.github/workflows/NetCoreTests.yml @@ -0,0 +1,57 @@ +name: .NET Core + +on: [push, pull_request] + +jobs: + db: + strategy: + fail-fast: false + matrix: + include: + - DB: SqlServer2008 + CONNECTION_STRING: "Server=localhost;initial catalog=nhibernate;User Id=sa;Password=P@ssw0rd;packet size=4096;" + - DB: PostgreSQL + CONNECTION_STRING: "Host=localhost;Username=nhibernate;Password=nhibernate;Database=nhibernate;Enlist=true;" + - DB: Firebird + CONNECTION_STRING: "DataSource=localhost;Database=nhibernate;User=SYSDBA;Password=nhibernate;charset=utf8;" + - DB: MySQL + CONNECTION_STRING: "Server=localhost;Uid=root;Password=nhibernate;Database=nhibernate;Old Guids=True;" + ALLOW_FAILURE: true + - DB: SQLite + runs-on: ubuntu-latest + continue-on-error: ${{matrix.ALLOW_FAILURE == true}} + env: + LANG: en-US.UTF-8 #default POSIX locale doesn't support ignore case comparisons + name: ${{matrix.DB}} + + steps: + - name: Set up SqlServer + if: matrix.DB == 'SqlServer2008' + run: | + 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; + + - name: Set up MySQL + if: matrix.DB == 'MySQL' + run: | + sudo service mysql stop + 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 + + - name: Set up PostgreSQL + if: matrix.DB == 'PostgreSQL' + run: | + docker run -d -e POSTGRES_USER=nhibernate -e POSTGRES_PASSWORD=nhibernate -e POSTGRES_DB=nhibernate -p 5432:5432 postgres:13 + + - name: Set up Firebird + if: matrix.DB == 'Firebird' + run: | + 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 + + - uses: actions/checkout@v2 + - name: Setup .NET + uses: actions/setup-dotnet@v1.8.0 + with: + dotnet-version: 2.1.x + + - name: Build and Test + run: | + pwsh -noprofile -command "& ./build.ps1 -TaskList Set-Configuration,Test -properties @{'Database' = '${{matrix.DB}}';'ConnectionString'='${{matrix.CONNECTION_STRING}}'}" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ca8fa9ba6a3..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,51 +0,0 @@ -os: linux -dist: xenial -language: csharp -mono: none -dotnet: 2.1.300 -services: - - mysql - - postgresql - - docker -env: - - DB=SqlServer2008 CONNECTION_STRING="Server=localhost;initial catalog=nhibernate;User Id=sa;Password=P@ssw0rd;packet size=4096;" - - DB=PostgreSQL CONNECTION_STRING="Host=localhost;Port=5432;Username=postgres;Database=nhibernate;Enlist=true;" - - DB=Firebird - - DB=MySQL CONNECTION_STRING="Server=127.0.0.1;Uid=root;Database=nhibernate;Old Guids=True;" - - DB=SQLite -matrix: - allow_failures: - - env: DB=MySQL CONNECTION_STRING="Server=127.0.0.1;Uid=root;Database=nhibernate;Old Guids=True;" -before_install: - - sudo apt-get update -qq - - sudo apt-get install -y powershell - - |- - if [[ "$DB" == "MySQL" ]] - then - echo -e '[server]\nlower_case_table_names=1\n[mysqld]\ncharacter-set-server=utf8\ncollation-server=utf8_general_ci' | sudo tee -a /etc/mysql/my.cnf - sudo service mysql restart - fi - - |- - if [[ "$DB" == "Firebird" ]] - then - sudo apt-get install -y libtommath-dev - # This would be required on bionic and above - # sudo ln -s /usr/lib/x86_64-linux-gnu/libtommath.so.1 /usr/lib/x86_64-linux-gnu/libtommath.so.0 - wget -q https://github.com/FirebirdSQL/firebird/releases/download/R3_0_5/Firebird-3.0.5.33220-0.amd64.tar.gz - tar xzvf Firebird-3.0.5.33220-0.amd64.tar.gz - pushd Firebird-3.0.5.33220-0.amd64 - sudo ./install.sh -silent - popd - export $(sudo cat /opt/firebird/SYSDBA.password | grep -v ^# | xargs) - sudo chmod 775 /tmp/firebird - echo -e "nhibernate = /tmp/firebird/nhibernate.fdb" | sudo tee -a /opt/firebird/databases.conf - echo -e "AuthServer = Srp\nAuthClient = Srp\nUserManager = Srp\nWireCrypt = Enabled" | sudo tee -a /opt/firebird/firebird.conf - sudo /opt/firebird/bin/gsec -modify SYSDBA -pw masterkey -admin yes - sudo systemctl restart firebird-superserver - fi -before_script: - - if [[ "$DB" == "SqlServer2008" ]]; then 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; fi - - if [[ "$DB" == "PostgreSQL" ]]; then psql -c "CREATE DATABASE nhibernate;" -U postgres; fi - - if [[ "$DB" == "MySQL" ]]; then mysql -e "CREATE DATABASE IF NOT EXISTS nhibernate;"; fi -script: - - pwsh -noprofile -command "& ./build.ps1 -TaskList Set-Configuration,Test -properties @{\"Database\" = \"$DB\";\"ConnectionString\"=\"$CONNECTION_STRING\"}"