Skip to content

Commit bb341d3

Browse files
committed
setup pre-run to grant correct mysql permissions
Signed-off-by: Joey Smith <jsmith@webinertia.net> Signed-off-by: Joey Smith <jsmith@webinertia.net>
1 parent 2d45173 commit bb341d3

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

.laminas-ci/mysql_permissions.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CREATE USER 'gha'@'%' IDENTIFIED WITH mysql_native_password BY 'password';
2+
GRANT ALL PRIVILEGES ON *.* TO 'gha'@'%';
3+
FLUSH PRIVILEGES;

.laminas-ci/pre-run.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
TEST_USER=$1
6+
WORKSPACE=$2
7+
JOB=$3
8+
9+
COMMAND=$(echo "${JOB}" | jq -r '.command')
10+
11+
if [[ ! ${COMMAND} =~ phpunit ]]; then
12+
exit 0
13+
fi
14+
15+
PHP_VERSION=$(echo "${JOB}" | jq -r '.php')
16+
17+
mysql -uroot -proot <"./mysql_permissions.sql"
18+
19+
# Install lsof (used in integration tests)
20+
apt update -qq
21+
apt install -yqq lsof

0 commit comments

Comments
 (0)