Repository navigation
92 lines (87 loc) · 3.68 KB
/
Copy pathqa.yml
File metadata and controls
92 lines (87 loc) · 3.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: QA
on:
schedule:
- cron: '23 4 * * *'
workflow_dispatch:
push:
branches:
- main
pull_request:
permissions:
contents: read
jobs:
qa:
uses: sympress/workflows/.github/workflows/sympress-qa.yml@2ebe47e2bc6d402c172015b64c0f5a9f2bf0c322 # v1.3.2
with:
include_root: true
package_glob: .github/no-composer-packages/*
php_version: '8.5'
secrets:
SSH_KEY: ${{ secrets.COMPOSER_SSH_KEY }}
SSH_KNOWN_HOSTS: ${{ secrets.COMPOSER_SSH_KNOWN_HOSTS }}
COMPOSER_AUTH_JSON: ${{ secrets.COMPOSER_AUTH_JSON }}
operations-tests:
name: Operations safety tests
# shortcut: ppa:ondrej/php has no Ubuntu 26.04 (resolute) build; move to packages.sury.org or the distro PHP when it ships php8.5-fpm.
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up native PHP test environment
uses: shivammathur/setup-php@eb7c497e18156a6bbabfef1d3a82760b9eda3962 # v2
with:
php-version: '8.5'
extensions: curl, dom, mbstring, opcache, xml, zip
tools: composer:2.10.3
coverage: none
- name: Install native operation fixtures
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install --no-install-recommends -y software-properties-common
sudo add-apt-repository --yes ppa:ondrej/php
sudo apt-get update
sudo apt-get install --no-install-recommends -y php8.5-fpm libfcgi-bin nginx
composer install --no-plugins --no-scripts --prefer-dist --no-interaction --no-progress
composer install --working-dir=deployment --no-plugins --no-scripts --prefer-dist --no-interaction --no-progress
- name: Verify backup, restore and monitoring controls
run: |
python3 - <<'PY'
import unittest
result = unittest.TextTestRunner(verbosity=2).run(unittest.defaultTestLoader.discover('dev-ops/tests'))
if result.skipped:
raise SystemExit('Native operation fixtures must run without skipped tests.')
raise SystemExit(0 if result.wasSuccessful() else 1)
PY
deploy-recipe:
name: Complete recipe on disposable SSH host
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Build isolated SSH, MariaDB and FPM host
run: docker build --tag sympress-deploy-host --file dev-ops/tests/deploy-host.Dockerfile .
- name: Exercise deployments, PHP-user checks and failed-health recovery
run: |
docker run --rm --volume "$GITHUB_WORKSPACE:/workspace" sympress-deploy-host '
set -euo pipefail
git config --global --add safe.directory /workspace
install -d -o mysql -g mysql /run/mysqld
if [ ! -f /var/lib/mysql/ibdata1 ]; then
mariadb-install-db --user=mysql --datadir=/var/lib/mysql --skip-test-db >/dev/null
fi
mariadbd --user=mysql --bind-address=127.0.0.1 --skip-log-bin >/tmp/mariadb.log 2>&1 &
for attempt in {1..100}; do
mariadb-admin ping --silent >/dev/null 2>&1 && break
sleep .1
done
composer install --no-plugins --no-scripts --prefer-dist --no-interaction --no-progress
composer install --working-dir=deployment --no-plugins --no-scripts --prefer-dist --no-interaction --no-progress
python3 dev-ops/tests/deploy_host_probe.py
'