Skip to content

Commit 1fc8b1d

Browse files
committed
try something a little different
1 parent 031fca7 commit 1fc8b1d

File tree

1 file changed

+59
-55
lines changed

1 file changed

+59
-55
lines changed

.github/workflows/ci.yml

+59-55
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,33 @@ jobs:
1515
build_and_test:
1616
runs-on: ubuntu-latest
1717

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
4545

4646
env:
4747
RAILS_ENV: test
@@ -68,37 +68,41 @@ jobs:
6868
gem update --system '3.3.22'
6969
gem install bundler -v '2.5.18'
7070
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
7278
# 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
8492
# 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
92104
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
102106
103107
- name: Show Database Logs
104108
run: |

0 commit comments

Comments
 (0)