-
Notifications
You must be signed in to change notification settings - Fork 34
166 lines (164 loc) · 6.06 KB
/
tests.yml
File metadata and controls
166 lines (164 loc) · 6.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: Tests
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
JAVA_OPTS: -Xmx2048m
JRUBY_OPTS: -W0
jobs:
test:
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
- JRUBY_VERSION: 10.0.4.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
CLICKHOUSE_DATABASE_HOST: localhost
steps:
- name: Checkout code
uses: actions/checkout@v6
- 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: Download ClickHouse JDBC driver
run: |
.github/workflows/clickhouse/download.sh
- name: Start ClickHouse
run: .github/workflows/clickhouse/docker.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 test
done
- name: Export test data and run ClickHouse tests
run: |
MONDRIAN_DRIVER=mysql bundle exec rake db:export_data
MONDRIAN_DRIVER=clickhouse bundle exec rake db:create_data
MONDRIAN_DRIVER=clickhouse bundle exec rake test
windows-test:
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.4.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@v6
- 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 "test\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 test:sqlserver