@@ -15,33 +15,33 @@ jobs:
15
15
build_and_test :
16
16
runs-on : ubuntu-latest
17
17
18
- services :
19
- postgres :
20
- image : postgres:11
21
- env :
22
- POSTGRES_USER : postgres
23
- POSTGRES_PASSWORD : postgres
24
- POSTGRES_HOST_AUTH_METHOD : trust
25
- options : >-
26
- --health-cmd="pg_isready -U postgres"
27
- --health-interval=10s
28
- --health-timeout=5s
29
- --health-retries=5
30
- ports :
31
- - 5432:5432
32
-
33
- mysql :
34
- image : mysql:5.6
35
- env :
36
- MYSQL_ALLOW_EMPTY_PASSWORD : " yes"
37
- options : >-
38
- --health-cmd="mysqladmin ping --silent"
39
- --health-interval=10s
40
- --health-timeout=5s
41
- --health-retries=10
42
- --memory=512m --cpus=0.5
43
- ports :
44
- - 3306:3306
18
+ # services:
19
+ # postgres:
20
+ # image: postgres:11
21
+ # env:
22
+ # POSTGRES_USER: postgres
23
+ # POSTGRES_PASSWORD: postgres
24
+ # POSTGRES_HOST_AUTH_METHOD: trust
25
+ # options: >-
26
+ # --health-cmd="pg_isready -U postgres"
27
+ # --health-interval=10s
28
+ # --health-timeout=5s
29
+ # --health-retries=10
30
+ # ports:
31
+ # - 5432:5432
32
+ #
33
+ # mysql:
34
+ # image: mysql:5.6
35
+ # env:
36
+ # MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
37
+ # options: >-
38
+ # --health-cmd="mysqladmin ping --silent"
39
+ # --health-interval=10s
40
+ # --health-timeout=5s
41
+ # --health-retries=10
42
+ # --memory=512m --cpus=0.5
43
+ # ports:
44
+ # - 3306:3306
45
45
46
46
env :
47
47
RAILS_ENV : test
@@ -68,37 +68,41 @@ jobs:
68
68
gem update --system '3.3.22'
69
69
gem install bundler -v '2.5.18'
70
70
71
- # - name: Set up PostgreSQL
71
+ # # - name: Set up PostgreSQL
72
+ # # run: |
73
+ # # docker exec ${{ job.services.postgres.id }} bash -c "psql -U postgres -c 'ALTER SYSTEM SET shared_buffers TO 65536;'"
74
+ # # docker exec ${{ job.services.postgres.id }} bash -c "psql -U postgres -c 'ALTER SYSTEM SET work_mem TO 4096;'"
75
+ # # docker exec ${{ job.services.postgres.id }} bash -c "psql -U postgres -c 'SELECT pg_reload_conf();'"
76
+ #
77
+ # - name: Set up MySQL
72
78
# run: |
73
- # docker exec ${{ job.services.postgres.id }} bash -c "psql -U postgres -c 'ALTER SYSTEM SET shared_buffers TO 65536;'"
74
- # docker exec ${{ job.services.postgres.id }} bash -c "psql -U postgres -c 'ALTER SYSTEM SET work_mem TO 4096;'"
75
- # docker exec ${{ job.services.postgres.id }} bash -c "psql -U postgres -c 'SELECT pg_reload_conf();'"
76
-
77
- - name : Set up MySQL
78
- run : |
79
- docker exec ${{ job.services.mysql.id }} bash -c "echo '[mysqld]' > /etc/mysql/conf.d/custom.cnf"
80
- docker exec ${{ job.services.mysql.id }} bash -c "echo 'innodb_buffer_pool_size=64M' >> /etc/mysql/conf.d/custom.cnf"
81
- docker restart ${{ job.services.mysql.id }}
82
-
83
- # - name: Wait for Database Services
79
+ # docker exec ${{ job.services.mysql.id }} bash -c "echo '[mysqld]' > /etc/mysql/conf.d/custom.cnf"
80
+ # docker exec ${{ job.services.mysql.id }} bash -c "echo 'innodb_buffer_pool_size=64M' >> /etc/mysql/conf.d/custom.cnf"
81
+ # docker restart ${{ job.services.mysql.id }}
82
+ #
83
+ # # - name: Wait for Database Services
84
+ # # run: |
85
+ # # sudo apt-get update
86
+ # # sudo apt-get install -y postgresql-client mysql-client
87
+ # # until pg_isready -h localhost -U postgres; do echo "Waiting for PostgreSQL..."; sleep 1; done
88
+ # # #until mysqladmin ping --silent; do echo "Waiting for MySQL..."; sleep 1; done
89
+ #
90
+ # # Re-check readiness
91
+ # - name: Wait for Database Services after restart
84
92
# run: |
85
- # sudo apt-get update
86
- # sudo apt-get install -y postgresql-client mysql-client
87
- # until pg_isready -h localhost -U postgres; do echo "Waiting for PostgreSQL..."; sleep 1; done
88
- # #until mysqladmin ping --silent; do echo "Waiting for MySQL..."; sleep 1; done
89
-
90
- # Re-check readiness
91
- - name : Wait for Database Services after restart
93
+ # until docker exec ${{ job.services.postgres.id }} pg_isready -U postgres; do
94
+ # echo "Waiting for PostgreSQL to be ready after restart..."
95
+ # sleep 2
96
+ # done
97
+ # # Uncomment if needed for MySQL
98
+ # # until docker exec ${{ job.services.mysql.id }} mysqladmin ping --silent; do
99
+ # # echo "Waiting for MySQL to be ready after restart..."
100
+ # # sleep 2
101
+ # # done
102
+
103
+ - name : Start App
92
104
run : |
93
- until docker exec ${{ job.services.postgres.id }} pg_isready -U postgres; do
94
- echo "Waiting for PostgreSQL to be ready after restart..."
95
- sleep 2
96
- done
97
- # Uncomment if needed for MySQL
98
- # until docker exec ${{ job.services.mysql.id }} mysqladmin ping --silent; do
99
- # echo "Waiting for MySQL to be ready after restart..."
100
- # sleep 2
101
- # done
105
+ docker-compose up -d
102
106
103
107
- name : Show Database Logs
104
108
run : |
0 commit comments