Skip to content

Commit 513660a

Browse files
authored
Merge pull request #1109 from headius/gha
Get GHA build working
2 parents 1088921 + 6c4cb2d commit 513660a

File tree

3 files changed

+51
-20
lines changed

3 files changed

+51
-20
lines changed

.github/workflows/ruby.yml

Lines changed: 49 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,54 @@ jobs:
2222
runs-on: ubuntu-latest
2323
strategy:
2424
matrix:
25-
ruby-version: ['jruby-9.3.4.0']
25+
ruby-version: ['jruby-9.2.20.1']
26+
db: ['mysql2']
27+
test_prefix: ["rails:"]
28+
ar_version: ["6-1-stable"]
29+
prepared_statements: ['false']
30+
# prepared_statements: ['false', 'true']
31+
driver: ['MySQL']
32+
# driver: ['', 'MariaDB']
33+
34+
services:
35+
mysql:
36+
image: mysql:5.7
37+
env:
38+
MYSQL_USER: root
39+
MYSQL_ROOT_PASSWORD: root
40+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
41+
ports:
42+
- 3306
43+
44+
env:
45+
DB: ${{ matrix.db }}
46+
TEST_PREFIX: ${{ matrix.test_prefix }}
47+
AR_VERSION: ${{ matrix.ar_version }}
48+
PREPARED_STATEMENTS: ${{ matrix.prepared_statements }}
49+
DRIVER: ${{ matrix.driver }}
2650

2751
steps:
28-
- uses: actions/checkout@v3
29-
- name: Set up Ruby
30-
uses: ruby/setup-ruby@v1
31-
with:
32-
ruby-version: ${{ matrix.ruby-version }}
33-
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
34-
- name: Run tests
35-
run: |
36-
echo "JAVA_OPTS=$JAVA_OPTS"
37-
export JRUBY_OPTS="-J-Xms64M -J-Xmx1024M"
38-
rake jar # compiles ext generates: lib/arjdbc/jdbc/adapter_java.jar
39-
mysql --version || true # to see if we're using MySQL or MariaDB
40-
rake db:mysql
41-
"mysql -e "CREATE USER rails@localhost;"
42-
mysql -e "grant all privileges on activerecord_unittest.* to rails@localhost;"
43-
mysql -e "grant all privileges on activerecord_unittest2.* to rails@localhost;"
44-
mysql -e "grant all privileges on inexistent_activerecord_unittest.* to rails@localhost;"
45-
mysql -e "CREATE DATABASE activerecord_unittest DEFAULT CHARACTER SET utf8mb4;"
46-
mysql -e "CREATE DATABASE activerecord_unittest2 DEFAULT CHARACTER SET utf8mb4;"
52+
- uses: actions/checkout@v3
53+
- name: Set up Ruby
54+
uses: ruby/setup-ruby@v1
55+
with:
56+
ruby-version: ${{ matrix.ruby-version }}
57+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
58+
- name: Install dependencies
59+
run: bundle install --retry 3 --without development
60+
- name: Setup database
61+
run: |
62+
echo "JAVA_OPTS=$JAVA_OPTS"
63+
export JRUBY_OPTS="-J-Xms64M -J-Xmx1024M"
64+
rake jar # compiles ext generates: lib/arjdbc/jdbc/adapter_java.jar
65+
sudo service mysql start
66+
mysql --version || true # to see if we're using MySQL or MariaDB
67+
mysql -u root -proot -e "CREATE USER rails@localhost;"
68+
mysql -u root -proot -e "grant all privileges on activerecord_unittest.* to rails@localhost;"
69+
mysql -u root -proot -e "grant all privileges on activerecord_unittest2.* to rails@localhost;"
70+
mysql -u root -proot -e "grant all privileges on inexistent_activerecord_unittest.* to rails@localhost;"
71+
mysql -u root -proot -e "CREATE DATABASE activerecord_unittest DEFAULT CHARACTER SET utf8mb4;"
72+
mysql -u root -proot -e "CREATE DATABASE activerecord_unittest2 DEFAULT CHARACTER SET utf8mb4;"
73+
- name: Run tests
74+
run: |
75+
bundle exec rake ${{ env.TEST_PREFIX }}test_${{ env.DB }}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
exclude :test_doesnt_error_when_a_select_query_has_encoding_errors, "encoding error"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
exclude :test_unicode_characters_for_enum_names, "encoding error"

0 commit comments

Comments
 (0)