Skip to content

Commit 315024d

Browse files
Hackwarlaoneo
andauthored
[5.3] Migrating Appveyor tests to Github Actions (#45651)
* Add CI Github workflow * install * faster * path * order * names * wait * no warning when no artefacts * integration pgsql * disable opcache * run tests with less output * no quiet * do not output the table * no hardcoded path * Better title * better * revert * normal output * use blacklist instead * restore browser * Add phpstan to github action (#45634) * Add phpstan to github action * Update ci.yml * Update ci.yml * Fix mysql matrix (#45636) * Reduce dependencies between steps * Migrate Appveyor tests to Github actions * Reverting Appveyor deletion * Update ci.yml --------- Co-authored-by: Allon Moritz <[email protected]>
1 parent 2fea432 commit 315024d

File tree

2 files changed

+98
-0
lines changed

2 files changed

+98
-0
lines changed

.github/workflows/ci.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,67 @@ jobs:
168168
POSTGRES_PASSWORD: joomla_ut
169169
POSTGRES_DB: test_joomla
170170

171+
tests-unit-windows:
172+
name: Run Unit tests (Windows)
173+
runs-on: windows-latest
174+
needs: [code-style-php]
175+
strategy:
176+
matrix:
177+
php_version: ['8.1', '8.2', '8.3', '8.4']
178+
steps:
179+
- uses: actions/checkout@v4
180+
- uses: actions/cache/restore@v4
181+
id: cache-php-windows
182+
with:
183+
path: libraries/vendor
184+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
185+
- name: Setup PHP
186+
uses: shivammathur/setup-php@v2
187+
with:
188+
php-version: ${{ matrix.php_version }}
189+
extensions: openssl, mbstring, fileinfo, gd, gmp, pgsql, mysql, mysqli, curl, opcache, ldap
190+
ini-values: post_max_size=256M, date.timezone="UTC"
191+
- name: Install Composer dependencies
192+
if: steps.cache-php-windows.outputs.cache-hit != 'true'
193+
run: composer install --no-progress --ignore-platform-reqs
194+
- name: Run Unit tests
195+
run: php libraries/vendor/bin/phpunit --testsuite Unit
196+
197+
tests-integration-windows:
198+
name: Run integration tests (Windows)
199+
runs-on: windows-latest
200+
needs: [code-style-php]
201+
strategy:
202+
matrix:
203+
php_version: ['8.1', '8.2', '8.3', '8.4']
204+
steps:
205+
- uses: actions/checkout@v4
206+
- uses: actions/cache/restore@v4
207+
with:
208+
path: libraries/vendor
209+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
210+
- uses: shogo82148/actions-setup-mysql@v1
211+
with:
212+
mysql-version: "mariadb-10.4"
213+
root-password: "joomla_ut"
214+
user: "joomla_ut"
215+
password: "joomla_ut"
216+
- name: Setup PHP
217+
uses: shivammathur/setup-php@v2
218+
with:
219+
php-version: ${{ matrix.php_version }}
220+
extensions: openssl, mbstring, fileinfo, gd, gmp, pgsql, mysql, mysqli, curl, opcache, ldap
221+
ini-values: post_max_size=256M, date.timezone="UTC"
222+
- name: Install Composer dependencies
223+
if: steps.cache-php-windows.outputs.cache-hit != 'true'
224+
run: |
225+
composer install --no-progress --ignore-platform-reqs
226+
mysql -uroot -pjoomla_ut -e 'CREATE DATABASE IF NOT EXISTS test_joomla;'
227+
- name: Run Integration tests
228+
run: |
229+
sleep 3
230+
php libraries/vendor/bin/phpunit --testsuite Integration --configuration phpunit-windows.xml.dist
231+
171232
tests-system-prepare:
172233
name: Prepare system tests
173234
runs-on: ubuntu-latest

phpunit-windows.xml.dist

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit bootstrap="tests/Unit/bootstrap.php" colors="false">
3+
<testsuites>
4+
<testsuite name="Unit">
5+
<directory suffix="Test.php">./tests/Unit</directory>
6+
</testsuite>
7+
<testsuite name="Integration">
8+
<directory suffix="Test.php">./tests/Integration</directory>
9+
</testsuite>
10+
</testsuites>
11+
<php>
12+
<const name="JTEST_DB_ENGINE" value="mysqli" />
13+
<const name="JTEST_DB_HOST" value="localhost" />
14+
<const name="JTEST_DB_NAME" value="test_joomla" />
15+
<const name="JTEST_DB_USER" value="joomla_ut" />
16+
<const name="JTEST_DB_PASSWORD" value="joomla_ut" />
17+
18+
<!--ldap settings are preconfigured to work with bitnami/openldap docker image-->
19+
<const name="JTEST_LDAP_HOST" value="" /> <!-- to disable ldap tests: set to an empty value -->
20+
<const name="JTEST_LDAP_PORT" value="1389" />
21+
<const name="JTEST_LDAP_PORT_SSL" value="1636" />
22+
<!--CACERTFILE path is relative to JPATH_ROOT-->
23+
<const name="JTEST_LDAP_CACERTFILE" value="./tests/certs/CA.crt" />
24+
<const name="JTEST_LDAP_USEV3" value="1" />
25+
<const name="JTEST_LDAP_NOREFERRALS" value="1" />
26+
<const name="JTEST_LDAP_BASE" value="dc=example,dc=org" />
27+
<const name="JTEST_LDAP_SEARCH" value="uid=[search]" />
28+
<const name="JTEST_LDAP_DIRECT_USERDN" value="cn=[username],ou=users,dc=example,dc=org" />
29+
<const name="JTEST_LDAP_FULLNAME" value="cn" />
30+
<const name="JTEST_LDAP_EMAIL" value="mail" />
31+
<const name="JTEST_LDAP_UID" value="uid" />
32+
<const name="JTEST_LDAP_SEARCH_DN" value="cn=customuser,ou=users,dc=example,dc=org" />
33+
<const name="JTEST_LDAP_SEARCH_PASSWORD" value="custompassword" />
34+
<const name="JTEST_LDAP_TESTUSER" value="customuser" />
35+
<const name="JTEST_LDAP_TESTPASSWORD" value="custompassword" />
36+
</php>
37+
</phpunit>

0 commit comments

Comments
 (0)