diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 46869cae..6edbb039 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -5,6 +5,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - run: sudo /lib/systemd/systemd-sysv-install enable mysql + - run: sudo systemctl enable mysql.service + - run: sudo systemctl start mysql.service + - run: sudo systemctl status mysql.service - run: cd server && make build - run: cd server && make run - run: cd server && make install-not-interactive diff --git a/server/Makefile b/server/Makefile index ed0071db..7c7179b1 100644 --- a/server/Makefile +++ b/server/Makefile @@ -14,8 +14,11 @@ install: @docker exec -u root -it opensupports-db bash -c "mysql -u root -e \"CREATE DATABASE IF NOT EXISTS development;\" " || echo "${red}Please execute 'make run' first${reset}" install-not-interactive: - @docker exec opensupports-srv bash -c "cd /var/www/html && composer install" || echo "${red}Please execute 'make run' first${reset}" - @docker exec -u root opensupports-db bash -c "mysql -u root -e \"CREATE DATABASE IF NOT EXISTS development;\" " || echo "${red}Please execute 'make run' first${reset}" + echo "${yellow}About to run COMPOSER INSTALL${reset}" + docker exec opensupports-srv bash -c "cd /var/www/html && composer install" || echo "${red}Please execute 'make run' first${reset}" + echo "${yellow}About to run CREATE DATABASE IF NOT EXISTS${reset}" + docker exec -u root opensupports-db bash -c "mysql -u root -e \"CREATE DATABASE IF NOT EXISTS development;\" " || echo "${red}Please execute 'make run' first${reset}" + echo "${yellow}About to FINISH INSTALL-NOT-INTERACTIVE${reset}" setup-vendor-permissions: @docker exec opensupports-srv bash -c "cd /var/www/html && chmod 777 -R vendor/ezyang" || echo "${red}Please execute 'make run' first${reset}" @@ -53,6 +56,9 @@ stop: db: @docker exec -it opensupports-db bash -c "mysql -u root" || echo "${red}Please execute 'make run' first${reset}" +db-sh: + @docker exec -it opensupports-db bash + sh: @docker exec -it opensupports-srv bash diff --git a/tests/truncate_db.sh b/tests/truncate_db.sh index aad5d05d..33053f01 100755 --- a/tests/truncate_db.sh +++ b/tests/truncate_db.sh @@ -1,6 +1,5 @@ #!/bin/bash # DELETE ALL TABLES -service mysql start; TABLES=$(mysql --host ${MYSQL_HOST} --port ${MYSQL_PORT} -u root development -e "SHOW TABLES IN development;" | awk '{ print $1}' | grep -v '^Tables') for t in $TABLES