diff --git a/.gitea/workflows/deploy-test.yml b/.gitea/workflows/deploy-test.yml index 9f7ce49..29585e2 100755 --- a/.gitea/workflows/deploy-test.yml +++ b/.gitea/workflows/deploy-test.yml @@ -25,19 +25,28 @@ jobs: fetch-depth: 1 - name: Setup SSH + env: + DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }} run: | + if [ -z "$DEPLOY_SSH_KEY" ]; then + echo "⚠️ DEPLOY_SSH_KEY secret not set — skipping deploy step" + echo "skip_deploy=1" >> $GITHUB_ENV + exit 0 + fi mkdir -p ~/.ssh - echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/id_ed25519 + echo "$DEPLOY_SSH_KEY" > ~/.ssh/id_ed25519 chmod 600 ~/.ssh/id_ed25519 ssh-keyscan -H 188.245.242.194 >> ~/.ssh/known_hosts 2>/dev/null echo "✅ SSH key configured" - name: Verify SSH connectivity + if: env.skip_deploy != '1' run: | ssh -o StrictHostKeyChecking=yes -i ~/.ssh/id_ed25519 \ haustest@188.245.242.194 "echo 'SSH-OK as:' \$(whoami) 'on' \$(hostname)" - name: Backup current test deployment + if: env.skip_deploy != '1' run: | ssh -i ~/.ssh/id_ed25519 haustest@188.245.242.194 \ "cd /home/haustest/htdocs && \ @@ -46,6 +55,7 @@ jobs: ls -lh /home/haustest/backup-pre-deploy-*.tar.gz | tail -1" - name: Rsync to test environment + if: env.skip_deploy != '1' run: | rsync -avz --delete \ --exclude='.git' \ @@ -77,6 +87,7 @@ jobs: ./ haustest@188.245.242.194:/home/haustest/htdocs/haus.test.kies-media.de/ - name: Smoke test + if: env.skip_deploy != '1' run: | sleep 2 echo "--- HTTP status codes ---" diff --git a/phpunit.xml b/phpunit.xml index b37abfc..e75a7ce 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -4,10 +4,11 @@ bootstrap="vendor/autoload.php" colors="true" cacheDirectory=".phpunit.cache" - failOnWarning="true" + failOnDeprecation="true" failOnRisky="true" failOnEmptyTestSuite="true" beStrictAboutOutputDuringTests="true" + cacheResultFile=".phpunit.cache/test-results" >