-
Notifications
You must be signed in to change notification settings - Fork 22
149 lines (130 loc) · 4.57 KB
/
tests.yml
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: "Tests"
on:
pull_request: ~
push:
branches:
- master
jobs:
test:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
experimental:
- false
php:
- "5.3"
- "5.4"
- "5.5"
- "5.6"
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-including-additional-values-into-combinations
include:
- php: "8.2"
experimental: true
env:
MYSQL_USER: "zftest"
MYSQL_PASSWORD: "zftest"
MYSQL_DATABASE: "zftest"
MYSQL_HOST: "127.0.0.1"
POSTGRES_USER: "zftest"
POSTGRES_PASSWORD: "zftest"
POSTGRES_DB: "zftest"
POSTGRES_HOST: "127.0.0.1"
# https://hub.docker.com/r/bitnami/openldap
LDAP_ROOT: "dc=example,dc=com"
LDAP_ALLOW_ANON_BINDING: false
LDAP_SKIP_DEFAULT_TREE: "yes"
LDAP_ADMIN_USERNAME: "admin"
LDAP_ADMIN_PASSWORD: "insecure"
LDAP_CONFIG_ADMIN_USERNAME: "admin"
LDAP_CONFIG_ADMIN_PASSWORD: "configpassword"
# Default locales are: C C.UTF-8 POSIX en_US.utf8
LOCALES: "fr_FR@euro fr_FR fr_BE.UTF-8 de en_US"
services:
memcache:
image: memcached:1-alpine
ports:
- 11211:11211
mysql:
image: mysql/mysql-server:5.7
ports:
- 3306:3306
env:
MYSQL_USER: ${{ env.MYSQL_USER }}
MYSQL_PASSWORD: ${{ env.MYSQL_PASSWORD }}
MYSQL_DATABASE: ${{ env.MYSQL_DATABASE }}
MYSQL_ALLOW_EMPTY_PASSWORD: "1"
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
postgres:
image: postgres:12
ports:
- 5432:5432
env:
POSTGRES_USER: ${{ env.POSTGRES_USER }}
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }}
POSTGRES_DB: ${{ env.POSTGRES_DB }}
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
openldap:
image: bitnami/openldap:2.5
ports:
- 1389:1389
env:
LDAP_ROOT: ${{ env.LDAP_ROOT }}
LDAP_ALLOW_ANON_BINDING: ${{ env.LDAP_ALLOW_ANON_BINDING }}
LDAP_SKIP_DEFAULT_TREE: ${{ env.LDAP_SKIP_DEFAULT_TREE }}
LDAP_ADMIN_USERNAME: ${{ env.LDAP_ADMIN_USERNAME }}
LDAP_ADMIN_PASSWORD: ${{ env.LDAP_ADMIN_PASSWORD }}
LDAP_CONFIG_ADMIN_ENABLED: "yes"
LDAP_CONFIG_ADMIN_USERNAME: ${{ env.LDAP_CONFIG_ADMIN_USERNAME }}
LDAP_CONFIG_ADMIN_PASSWORD: ${{ env.LDAP_CONFIG_ADMIN_PASSWORD }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
ini-values: display_errors=off, log_errors=on
tools: cs2pr
extensions: :xdebug, ctype, dom, gd, iconv, ldap, mbstring, reflection, session, simplexml, spl, xml, zlib, memcache, pdo_sqlite, bcmath
env:
# https://github.com/shivammathur/setup-php/issues/407#issuecomment-773675741
fail-fast: true
# https://github.com/zf1s/zf1/pull/6#issuecomment-495397170
- name: Validate composer.json for all packages
run: |
for json in composer.json packages/*/composer.json; do echo COMPOSER=$json; done | parallel env {} composer validate
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Lint PHP source files
run: |
composer lint.checkstyle | cs2pr
- name: Setup environment for PHPUnit
run: |
cp tests/TestConfiguration.ci.php tests/TestConfiguration.php
echo "Existing locales"
locale -a
sudo apt-get update && sudo apt-get install tzdata locales -y && sudo locale-gen $LOCALES
echo "All languages..."
locale -a
- name: Setup LDAP
run: |
sudo apt-get install -y libnss-ldap libpam-ldap ldap-utils
tests/resources/openldap/docker-entrypoint-initdb.d/init.sh
- name: "Run PHPUnit tests (Experimental: ${{ matrix.experimental }})"
run: vendor/bin/phpunit --verbose
continue-on-error: ${{ matrix.experimental }}
# vim:ft=yaml:et:ts=2:sw=2