Skip to content

Commit

Permalink
fixing github actions steps and configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed Apr 14, 2026
1 parent 5585c04 commit fc9ab3b
Showing 1 changed file with 36 additions and 2 deletions.
38 changes: 36 additions & 2 deletions .github/workflows/registry-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ jobs:
MARIADB_USER: test_user
MARIADB_PASSWORD: test_password
MARIADB_ROOT_PASSWORD: root_password
options: >-
--health-cmd "${{ matrix.db.health_cmd }}"
--health-interval 10s
--health-timeout 5s
--health-retries 20
env:
COMANAGE_REGISTRY_DIR: /srv/comanage-registry
Expand All @@ -55,8 +60,8 @@ jobs:
DB_ENGINE: ${{ matrix.db.engine }}

# DB service connection info (because you publish ports)
COMANAGE_REGISTRY_DATABASE_HOST: db
COMANAGE_REGISTRY_DATABASE_PORT: ${{ matrix.db.port }}
# COMANAGE_REGISTRY_DATABASE_HOST: db
# COMANAGE_REGISTRY_DATABASE_PORT: ${{ matrix.db.port }}

# Values used by your PHPUnit setup test
COMANAGE_REGISTRY_ADMIN_GIVEN_NAME: Admin
Expand Down Expand Up @@ -178,6 +183,35 @@ jobs:
;;
esac
- name: Export DB host/port (service container IP)
shell: bash
run: |
set -euxo pipefail
DB_HOST="$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' '${{ job.services.db.id }}')"
echo "Resolved DB_HOST=${DB_HOST}"
case "${DB_ENGINE}" in
postgres) DB_PORT=5432 ;;
mysql|mariadb) DB_PORT=3306 ;;
*) echo "Unknown DB_ENGINE=${DB_ENGINE}"; exit 1 ;;
esac
echo "COMANAGE_REGISTRY_DATABASE_HOST=${DB_HOST}" >> "$GITHUB_ENV"
echo "COMANAGE_REGISTRY_DATABASE_PORT=${DB_PORT}" >> "$GITHUB_ENV"`
- name: Smoke test DB TCP port
shell: bash
run: |
set -euxo pipefail
php -r '
$h=getenv("COMANAGE_REGISTRY_DATABASE_HOST"); $p=(int)getenv("COMANAGE_REGISTRY_DATABASE_PORT");
$fp=@fsockopen($h,$p,$errno,$errstr,5);
if(!$fp){fwrite(STDERR,"TCP connect failed: $errno $errstr\n"); exit(1);}
fclose($fp);
echo "TCP connect OK to $h:$p\n";
'
- name: Create local/config/database.php placeholder
shell: bash
run: |
Expand Down

0 comments on commit fc9ab3b

Please sign in to comment.