Skip to content

Commit 07240f6

Browse files
committed
setup tablespace in workflow
1 parent b63b7fa commit 07240f6

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/run-tests.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,34 @@ jobs:
3838
# Update the runtime link path
3939
echo "/home/runner/work/_temp/instantclient_23_9" | sudo tee /etc/ld.so.conf.d/oracle-instantclient.conf
4040
sudo ldconfig
41+
42+
- name: Wait for Oracle to be ready
43+
run: |
44+
# Wait until Oracle is accepting connections
45+
for i in {1..30}; do
46+
if docker exec $(docker ps -qf "ancestor=gvenzl/oracle-free:latest") \
47+
bash -c "echo exit | sqlplus -s / as sysdba" >/dev/null 2>&1; then
48+
echo "Oracle is ready!"
49+
break
50+
fi
51+
echo "Waiting for Oracle..."
52+
sleep 10
53+
done
54+
55+
- name: Get SYS password from Oracle logs
56+
id: get-sys-pass
57+
run: |
58+
CONTAINER_ID=$(docker ps -qf "ancestor=gvenzl/oracle-free:latest")
59+
SYS_PASS=$(docker logs $CONTAINER_ID 2>&1 | grep "DATABASE IS READY TO USE!" -B20 | grep "SYS Password:" | awk '{print $3}')
60+
echo "SYS_PASS=$SYS_PASS" >> $GITHUB_ENV
61+
62+
- name: Create tablespace and grant user access
63+
run: |
64+
cat <<'EOF' > alter_user.sql
65+
ALTER USER $GORM_ORACLEDB_USER QUOTA UNLIMITED ON SYSAUX;
66+
EOF
67+
68+
$GORM_ORACLEDB_LIBDIR/sqlplus -s sys/${SYS_PASS}@${GORM_ORACLEDB_CONNECTSTRING} AS SYSDBA @alter_user.sql
4169
4270
- name: Checkout
4371
uses: actions/checkout@v4

0 commit comments

Comments
 (0)