From a279fd7cfc9d169faf680d80d207cedf5416e5f9 Mon Sep 17 00:00:00 2001 From: Etienne Trimaille Date: Mon, 13 Jan 2025 15:43:30 +0100 Subject: [PATCH] GH Action - Check for QGIS Server status and git diff --- .github/workflows/e2e_tests.yml | 34 ++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e_tests.yml b/.github/workflows/e2e_tests.yml index c1d250c09b..db498149df 100644 --- a/.github/workflows/e2e_tests.yml +++ b/.github/workflows/e2e_tests.yml @@ -95,11 +95,43 @@ jobs: - name: Build and start docker images run: ./run-docker up --build -d - - name: Wait docker images ready and install Lizmap + - name: Wait 30 secondes for docker images to be ready run: | sleep 30 + + - name: Install Lizmap + run: | ./lizmap-ctl install + - name: Wait and check about QGIS Server status + run: | + curl \ + --user 'admin:admin' \ + --retry 30 \ + --retry-delay 5 \ + -vN \ + "http://localhost:8130/index.php/view/app/metadata" \ + -o /tmp/test-qgis-server.json + # cat /tmp/test-qgis-server.json + qgis_info=$(cat /tmp/test-qgis-server.json | jq --raw-output '.qgis_server_info.error') + echo $qgis_info + if [[ "$qgis_info" != "null" ]]; then + echo "QGIS Server is not well configured" + echo "::warning QGIS Server was not up" + else + echo "JSON metadata OK about QGIS Server" + fi + + - name: Check about updated files after a build (PHP or JS) + run: | + if [[ -z $(git status --porcelain -uno) ]]; then + echo "No updated files" + else + echo "Updated files" + git status + echo "::warning Git status is not clean" + fi + - name: Load SQL data run: | cd qgis-projects/tests