Merge pull request #148 from rsim/improvement/log4j2_25_3 #36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| env: | |
| JAVA_OPTS: -Xmx2048m | |
| JRUBY_OPTS: -W0 | |
| jobs: | |
| rspec: | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - JRUBY_VERSION: 9.4.14.0 | |
| JAVA_VERSION: 8 | |
| - JRUBY_VERSION: 9.4.14.0 | |
| JAVA_VERSION: 11 | |
| - JRUBY_VERSION: 9.4.14.0 | |
| JAVA_VERSION: 17 | |
| # Tests on JRuby 10 are failing due to https://github.com/jruby/jruby/issues/8987 | |
| # - JRUBY_VERSION: 10.0.2.0 | |
| # JAVA_VERSION: 21 | |
| env: | |
| JRUBY_VERSION: ${{ matrix.JRUBY_VERSION }} | |
| JAVA_VERSION: ${{ matrix.JAVA_VERSION }} | |
| ORACLE_FILE: oracle11g/xe/oracle-xe-11.2.0-1.0.x86_64.rpm.zip | |
| ORACLE_HOME: /u01/app/oracle/product/11.2.0/xe | |
| NLS_LANG: AMERICAN_AMERICA.AL32UTF8 | |
| ORACLE_SID: XE | |
| ORACLE_DATABASE_NAME: XE | |
| MYSQL_ROOT_PASSWORD: root | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Edit hosts | |
| run: | | |
| echo "127.0.0.1 mssql.vm" | sudo tee -a /etc/hosts | |
| echo "127.0.0.1 oracle.vm" | sudo tee -a /etc/hosts | |
| - name: Install dependencies (Ubuntu) | |
| if: runner.os == 'Linux' | |
| # following sudo rm... line is workaround for https://github.com/actions/runner-images/issues/9733 | |
| run: | | |
| sudo rm /etc/apt/sources.list.d/microsoft-prod.list | |
| sudo apt-get update | |
| sudo apt-get install -y haveged | |
| - name: Output CPU information | |
| run: | | |
| lscpu | |
| free | |
| - name: Set JAVA home | |
| run: echo "JAVA_HOME=$JAVA_HOME_${{ matrix.JAVA_VERSION }}_X64" >> $GITHUB_ENV | |
| - name: Output JAVA version | |
| run: $JAVA_HOME/bin/java -version | |
| - name: Setup MySQL8 | |
| uses: mirromutth/mysql-action@de1fba8b3f90ce8db80f663a7043be3cf3231248 #v1.1 | |
| with: | |
| character set server: 'utf8' | |
| collation server: 'utf8_general_ci' | |
| mysql version: '8.0.28' | |
| mysql root password: ${{ env.MYSQL_ROOT_PASSWORD }} | |
| - name: Start PostgreSQL | |
| run: | | |
| sudo cp -f .github/workflows/pg_hba.conf /etc/postgresql/16/main/pg_hba.conf | |
| sudo systemctl start postgresql.service | |
| pg_isready | |
| - name: Install Oracle | |
| run: | | |
| echo "$ORACLE_HOME/jdbc/lib" >> $GITHUB_PATH | |
| .github/workflows/oracle/download.sh | |
| .github/workflows/oracle/install.sh | |
| - name: Install a SQL Server | |
| uses: potatoqualitee/mssqlsuite@410e5bb088db9593643dc560d30d54ffe0e78ead #v1.8 | |
| with: | |
| install: sqlengine, sqlclient | |
| sa-password: Password12! | |
| - name: Download SQL Server JDBC driver | |
| run: | | |
| .github/workflows/sqlserver/download.sh | |
| - name: Setup Ruby and install gems | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: 'jruby-${{env.JRUBY_VERSION}}' | |
| bundler-cache: true | |
| - name: Setup DB | |
| run: .github/workflows/create_db_schemas.sh | |
| - name: Run Tests | |
| run: | | |
| for driver in mysql postgresql oracle sqlserver; do | |
| MONDRIAN_DRIVER=$driver bundle exec rake spec | |
| done | |
| windows-rspec: | |
| runs-on: windows-2025 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - JRUBY_VERSION: 9.4.14.0 | |
| JAVA_VERSION: 8 | |
| - JRUBY_VERSION: 9.4.14.0 | |
| JAVA_VERSION: 11 | |
| - JRUBY_VERSION: 9.4.14.0 | |
| JAVA_VERSION: 17 | |
| # - JRUBY_VERSION: 10.0.2.0 | |
| # JAVA_VERSION: 21 | |
| env: | |
| JRUBY_VERSION: ${{ matrix.JRUBY_VERSION }} | |
| JAVA_VERSION: ${{ matrix.JAVA_VERSION }} | |
| MONDRIAN_DRIVER: sqlserver | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Edit hosts | |
| run: | | |
| echo "127.0.0.1 mssql.vm" | Out-File -Append -FilePath C:\Windows\System32\drivers\etc\hosts | |
| - name: Output System information | |
| run: systeminfo | |
| - name: Set JAVA home | |
| run: | | |
| $javaEnvVarName = "JAVA_HOME_${env:JAVA_VERSION}_X64" | |
| $env:JAVA_HOME = (Get-Item -Path Env:$javaEnvVarName).Value | |
| $env:PATH = "$env:JAVA_HOME\bin;$env:PATH" | |
| echo "JAVA_HOME=$env:JAVA_HOME" | Out-File -FilePath $env:GITHUB_ENV -Append | |
| echo "PATH=$env:PATH" | Out-File -FilePath $env:GITHUB_ENV -Append | |
| - name: Output JAVA version | |
| run: java -version | |
| - name: Setup SQL Server | |
| uses: potatoqualitee/mssqlsuite@410e5bb088db9593643dc560d30d54ffe0e78ead #v1.8 | |
| with: | |
| install: sqlengine | |
| sa-password: Password12! | |
| - name: Download SQL Server JDBC driver | |
| run: | | |
| Invoke-WebRequest -Uri "https://download.microsoft.com/download/4/D/C/4DCD85FA-0041-4D2E-8DD9-833C1873978C/sqljdbc_7.2.1.0_enu.exe" -OutFile "sqljdbc_7.2.1.0_enu.exe" | |
| 7z x sqljdbc_7.2.1.0_enu.exe -y > nul | |
| Copy-Item -Path "sqljdbc_7.2\enu\mssql-jdbc-7.2.1.jre8.jar" -Destination "spec\support\jars\" | |
| - name: Setup Ruby and install gems | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: 'jruby-${{ env.JRUBY_VERSION }}' | |
| bundler-cache: true | |
| - name: Setup DB | |
| run: | | |
| sqlcmd -S "(local)" -U "sa" -P "Password12!" -Q "CREATE LOGIN mondrian_test WITH PASSWORD = 'mondrian_test', CHECK_POLICY = OFF" | |
| sqlcmd -S "(local)" -U "sa" -P "Password12!" -Q "ALTER SERVER ROLE [dbcreator] ADD MEMBER [mondrian_test]" | |
| sqlcmd -S "(local)" -U "mondrian_test" -P "mondrian_test" -Q "CREATE DATABASE mondrian_test" | |
| - name: Create Database Data | |
| run: bundle exec rake db:create_data | |
| - name: Run Tests | |
| run: bundle exec rake spec:sqlserver |