ci: make PHPUnit failOnDeprecation (was failOnWarning) + deploy-test skip when SSH key missing
Some checks failed
Deploy Feature Branch to Test (haus.test.kies-media.de) / Deploy to Test Environment (push) Successful in 50s
Lint / PHP Syntax Check (push) Successful in 1m4s
PHPUnit / PHP Unit Tests (push) Failing after 36s
Lint / PHP Syntax Check (pull_request) Successful in 29s
Lint / HTML Lint (htmlhint) (push) Successful in 1m43s
Lint / CSS Lint (stylelint) (push) Successful in 1m48s
PHPUnit / PHP Unit Tests (pull_request) Failing after 45s
Lint / CSS Lint (stylelint) (pull_request) Successful in 1m19s
Lint / HTML Lint (htmlhint) (pull_request) Successful in 1m20s
Some checks failed
Deploy Feature Branch to Test (haus.test.kies-media.de) / Deploy to Test Environment (push) Successful in 50s
Lint / PHP Syntax Check (push) Successful in 1m4s
PHPUnit / PHP Unit Tests (push) Failing after 36s
Lint / PHP Syntax Check (pull_request) Successful in 29s
Lint / HTML Lint (htmlhint) (push) Successful in 1m43s
Lint / CSS Lint (stylelint) (push) Successful in 1m48s
PHPUnit / PHP Unit Tests (pull_request) Failing after 45s
Lint / CSS Lint (stylelint) (pull_request) Successful in 1m19s
Lint / HTML Lint (htmlhint) (pull_request) Successful in 1m20s
This commit is contained in:
@@ -25,19 +25,28 @@ jobs:
|
|||||||
fetch-depth: 1
|
fetch-depth: 1
|
||||||
|
|
||||||
- name: Setup SSH
|
- name: Setup SSH
|
||||||
|
env:
|
||||||
|
DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
|
||||||
run: |
|
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
|
mkdir -p ~/.ssh
|
||||||
echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/id_ed25519
|
echo "$DEPLOY_SSH_KEY" > ~/.ssh/id_ed25519
|
||||||
chmod 600 ~/.ssh/id_ed25519
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
ssh-keyscan -H 188.245.242.194 >> ~/.ssh/known_hosts 2>/dev/null
|
ssh-keyscan -H 188.245.242.194 >> ~/.ssh/known_hosts 2>/dev/null
|
||||||
echo "✅ SSH key configured"
|
echo "✅ SSH key configured"
|
||||||
|
|
||||||
- name: Verify SSH connectivity
|
- name: Verify SSH connectivity
|
||||||
|
if: env.skip_deploy != '1'
|
||||||
run: |
|
run: |
|
||||||
ssh -o StrictHostKeyChecking=yes -i ~/.ssh/id_ed25519 \
|
ssh -o StrictHostKeyChecking=yes -i ~/.ssh/id_ed25519 \
|
||||||
haustest@188.245.242.194 "echo 'SSH-OK as:' \$(whoami) 'on' \$(hostname)"
|
haustest@188.245.242.194 "echo 'SSH-OK as:' \$(whoami) 'on' \$(hostname)"
|
||||||
|
|
||||||
- name: Backup current test deployment
|
- name: Backup current test deployment
|
||||||
|
if: env.skip_deploy != '1'
|
||||||
run: |
|
run: |
|
||||||
ssh -i ~/.ssh/id_ed25519 haustest@188.245.242.194 \
|
ssh -i ~/.ssh/id_ed25519 haustest@188.245.242.194 \
|
||||||
"cd /home/haustest/htdocs && \
|
"cd /home/haustest/htdocs && \
|
||||||
@@ -46,6 +55,7 @@ jobs:
|
|||||||
ls -lh /home/haustest/backup-pre-deploy-*.tar.gz | tail -1"
|
ls -lh /home/haustest/backup-pre-deploy-*.tar.gz | tail -1"
|
||||||
|
|
||||||
- name: Rsync to test environment
|
- name: Rsync to test environment
|
||||||
|
if: env.skip_deploy != '1'
|
||||||
run: |
|
run: |
|
||||||
rsync -avz --delete \
|
rsync -avz --delete \
|
||||||
--exclude='.git' \
|
--exclude='.git' \
|
||||||
@@ -77,6 +87,7 @@ jobs:
|
|||||||
./ haustest@188.245.242.194:/home/haustest/htdocs/haus.test.kies-media.de/
|
./ haustest@188.245.242.194:/home/haustest/htdocs/haus.test.kies-media.de/
|
||||||
|
|
||||||
- name: Smoke test
|
- name: Smoke test
|
||||||
|
if: env.skip_deploy != '1'
|
||||||
run: |
|
run: |
|
||||||
sleep 2
|
sleep 2
|
||||||
echo "--- HTTP status codes ---"
|
echo "--- HTTP status codes ---"
|
||||||
|
|||||||
@@ -4,10 +4,11 @@
|
|||||||
bootstrap="vendor/autoload.php"
|
bootstrap="vendor/autoload.php"
|
||||||
colors="true"
|
colors="true"
|
||||||
cacheDirectory=".phpunit.cache"
|
cacheDirectory=".phpunit.cache"
|
||||||
failOnWarning="true"
|
failOnDeprecation="true"
|
||||||
failOnRisky="true"
|
failOnRisky="true"
|
||||||
failOnEmptyTestSuite="true"
|
failOnEmptyTestSuite="true"
|
||||||
beStrictAboutOutputDuringTests="true"
|
beStrictAboutOutputDuringTests="true"
|
||||||
|
cacheResultFile=".phpunit.cache/test-results"
|
||||||
>
|
>
|
||||||
<testsuites>
|
<testsuites>
|
||||||
<testsuite name="Unit">
|
<testsuite name="Unit">
|
||||||
|
|||||||
Reference in New Issue
Block a user