@@ -4,7 +4,6 @@ concurrency:
4
4
cancel-in-progress : true
5
5
on :
6
6
workflow_dispatch :
7
- description : " This action tests backwards compatibility when db migrations are introduced. It tests database schema at new code(old_cc_ref) with unittests running old code(new_cc_ref) "
8
7
inputs :
9
8
old_cc_ref :
10
9
description : ' Old Version of CC_NG that the backwards compatibility should be checked against'
44
43
--health-interval 10s
45
44
--health-timeout 5s
46
45
--health-retries 5
46
+ --tmpfs /var/lib/postgresql/data
47
+ --shm-size=256m
47
48
ports :
48
49
- 5432:5432
49
50
steps :
63
64
)}}
64
65
- name : Setup Environment
65
66
uses : ./.github/workflows/composite/setup
67
+ - name : Configure PostgreSQL for performance
68
+ run : |
69
+ sudo apt-get update && sudo apt-get install -y postgresql-client
70
+ PGPASSWORD=rootpassword psql -h localhost -U postgres -c "ALTER SYSTEM SET fsync = off;"
71
+ PGPASSWORD=rootpassword psql -h localhost -U postgres -c "ALTER SYSTEM SET synchronous_commit = off;"
72
+ PGPASSWORD=rootpassword psql -h localhost -U postgres -c "ALTER SYSTEM SET full_page_writes = off;"
73
+ PGPASSWORD=rootpassword psql -h localhost -U postgres -c "ALTER SYSTEM SET checkpoint_completion_target = 0.9;"
74
+ PGPASSWORD=rootpassword psql -h localhost -U postgres -c "ALTER SYSTEM SET wal_buffers = '16MB';"
75
+ PGPASSWORD=rootpassword psql -h localhost -U postgres -c "ALTER SYSTEM SET shared_buffers = '256MB';"
76
+ PGPASSWORD=rootpassword psql -h localhost -U postgres -c "SELECT pg_reload_conf();"
66
77
- name : Migrate Database
67
78
run : DB=postgres POSTGRES_CONNECTION_PREFIX="postgres://postgres:rootpassword@localhost:5432" bundle exec rake db:parallel:recreate db:parallel:migrate
68
79
- name : Checkout code to run the unit tests with
@@ -92,7 +103,13 @@ jobs:
92
103
env :
93
104
MYSQL_DATABASE : cc_test
94
105
MYSQL_ROOT_PASSWORD : password
95
- options : --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
106
+ options : >-
107
+ --health-cmd="mysqladmin ping"
108
+ --health-interval=10s
109
+ --health-timeout=5s
110
+ --health-retries=3
111
+ --tmpfs /var/lib/mysql
112
+ --tmpfs /tmp
96
113
ports :
97
114
- 3306:3306
98
115
steps :
@@ -112,6 +129,14 @@ jobs:
112
129
)}}
113
130
- name : Setup Environment
114
131
uses : ./.github/workflows/composite/setup
132
+ - name : Configure MySQL for performance
133
+ run : |
134
+ sudo apt-get update && sudo apt-get install -y mysql-client
135
+ mysql -h 127.0.0.1 -u root -ppassword -e "SET GLOBAL innodb_flush_method = 'nosync';" || true
136
+ mysql -h 127.0.0.1 -u root -ppassword -e "SET GLOBAL innodb_flush_log_at_trx_commit = 0;" || true
137
+ mysql -h 127.0.0.1 -u root -ppassword -e "SET GLOBAL innodb_doublewrite = 0;" || true
138
+ mysql -h 127.0.0.1 -u root -ppassword -e "SET GLOBAL innodb_buffer_pool_size = 268435456;" || true
139
+ mysql -h 127.0.0.1 -u root -ppassword -e "SET GLOBAL innodb_log_buffer_size = 16777216;" || true
115
140
- name : Migrate Database
116
141
run :
DB=mysql MYSQL_CONNECTION_PREFIX="mysql2://root:[email protected] :3306" bundle exec rake db:parallel:recreate db:parallel:migrate
117
142
- name : Checkout code to run the unit tests with
@@ -125,4 +150,4 @@ jobs:
125
150
- name : Setup Environment
126
151
uses : ./.github/workflows/composite/setup
127
152
- name : Run tests
128
- run :
DB=mysql MYSQL_CONNECTION_PREFIX="mysql2://root:[email protected] :3306" bundle exec rake spec:without_migrate
153
+ run :
DB=mysql MYSQL_CONNECTION_PREFIX="mysql2://root:[email protected] :3306" bundle exec rake spec:without_migrate
0 commit comments