Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
213 changes: 213 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
name: CI Joomla Framework

on:
push:
pull_request:
schedule:
- cron: 15 2 * * 1

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
composer:
name: Install PHP dependencies
runs-on: ubuntu-latest
container: joomlaprojects/docker-images:php8.1
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
id: cache-php
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
- name: Install PHP dependencies
if: steps.cache-php.outputs.cache-hit != 'true'
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
composer config --global home
composer install --no-progress --ignore-platform-reqs

code-style-php:
name: Check PHP code style
runs-on: ubuntu-latest
container: joomlaprojects/docker-images:php8.1
needs: [composer]
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
- name: Check PHP code style
env:
PHP_CS_FIXER_IGNORE_ENV: true
run: ./vendor/bin/phpcs --standard=ruleset.xml src/

phpstan:
name: Run PHPstan
runs-on: ubuntu-latest
container: joomlaprojects/docker-images:php8.4
needs: [code-style-php]
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
with:
path: vendor
key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }}
- name: Run PHPstan
run: |
./vendor/bin/phpstan --error-format=github

tests-unit-sqlite:
name: Run Unit tests on SQLite
runs-on: ubuntu-latest
container: joomlaprojects/docker-images:php${{ matrix.php_version }}
needs: [code-style-php]
strategy:
matrix:
php_version: ['8.1', '8.2', '8.3']
steps:
- uses: actions/checkout@v4
- name: Run Unit tests
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
composer update
./vendor/bin/phpunit --configuration phpunit.sqlite.xml.dist

tests-unit-mysql:
name: Run Unit tests on MySQL
runs-on: ubuntu-latest
container: joomlaprojects/docker-images:php${{ matrix.php_version }}
needs: [code-style-php]
strategy:
matrix:
php_version: ['8.1', '8.2', '8.3']
db_engine: ['mysql', 'mysqli']
db_version: ['5.7', '8.0']
steps:
- uses: actions/checkout@v4
- name: Run Unit tests
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
composer update
./vendor/bin/phpunit --configuration phpunit.${{ matrix.db_engine }}.xml.dist
services:
mysql:
image: mysql:${{ matrix.db_version }}
env:
MYSQL_USER: joomla_ut
MYSQL_PASSWORD: joomla_ut
MYSQL_ROOT_PASSWORD: joomla_ut
MYSQL_DATABASE: joomla_ut

tests-unit-mariadb:
name: Run Unit tests on MariaDB
runs-on: ubuntu-latest
container: joomlaprojects/docker-images:php${{ matrix.php_version }}
needs: [code-style-php]
strategy:
matrix:
php_version: ['8.1', '8.2', '8.3']
steps:
- uses: actions/checkout@v4
- name: Run Unit tests
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
composer update
./vendor/bin/phpunit --configuration phpunit.mariadb.xml.dist
services:
mariadb:
image: mariadb:10.2
env:
MARIADB_USER: joomla_ut
MARIADB_PASSWORD: joomla_ut
MARIADB_ROOT_PASSWORD: joomla_ut
MARIADB_DATABASE: joomla_ut

tests-unit-postgres:
name: Run Unit tests on PostgreSQL
runs-on: ubuntu-latest
container: joomlaprojects/docker-images:php${{ matrix.php_version }}
needs: [code-style-php]
strategy:
matrix:
php_version: ['8.1', '8.2', '8.3']
db_version: ['10', '11']
steps:
- uses: actions/checkout@v4
- name: Run Unit tests
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
composer update
./vendor/bin/phpunit --configuration phpunit.pgsql.xml.dist
services:
postgres:
image: postgres:${{ matrix.db_version }}-alpine
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: joomla_ut
POSTGRES_DB: test_joomla

tests-unit-sqlsrv:
name: Run Unit tests on SQLsrv
runs-on: ubuntu-latest
container: joomlaprojects/docker-images:php${{ matrix.php_version }}
needs: [code-style-php]
strategy:
matrix:
php_version: ['8.1', '8.2', '8.3']
steps:
- uses: actions/checkout@v4
- name: Run Unit tests
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
apt-get update
apt-get install -y software-properties-common lsb-release gnupg
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
echo "deb [arch=amd64,armhf,arm64] https://packages.microsoft.com/ubuntu/22.04/prod jammy main" >> /etc/apt/sources.list
apt-get update
ACCEPT_EULA=Y apt-get install -y msodbcsql18 unixodbc-dev
pecl install sqlsrv && docker-php-ext-enable sqlsrv
pecl install pdo_sqlsrv && docker-php-ext-enable pdo_sqlsrv
php --ri sqlsrv
php --ri pdo_sqlsrv
composer update
./vendor/bin/phpunit --configuration phpunit.sqlsrv.xml.dist
services:
sqlsrv:
image: mcr.microsoft.com/mssql/server:2017-latest
env:
SA_PASSWORD: Password12!
ACCEPT_EULA: Y
MSSQL_PID: Developer

tests-unit-windows:
name: Run Unit tests on MSSQL (Windows)
runs-on: windows-latest
needs: [code-style-php]
strategy:
matrix:
php_version: ['8.1', '8.2', '8.3']
steps:
- uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php_version }}
extensions: openssl, mbstring, fileinfo, ftp, sqlsrv
- name: Install MSSQL
uses: potatoqualitee/mssqlsuite@v1.8
with:
install: sqlengine, sqlclient
version: 2019
sa-password: 'Password12!'
show-log: true
- name: Install Composer dependencies
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
composer install --no-progress --ignore-platform-reqs
- name: Run Unit tests
run: php vendor/bin/phpunit -c phpunit.appveyor_sql2019.xml.dist
16 changes: 13 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
/.idea/
build/
# IDE Related Files #
.buildpath
.project
.settings
.DS_Store
.idea

# Composer and test related files #
vendor/
composer.phar
composer.lock
phpunit.xml
phpunit.*.xml
.phpunit.result.cache
.phpunit.cache/
.idea/
/.phpunit.result.cache
/.phpunit.cache/
/.github/
Loading
Loading