mirror of
https://github.com/werkraum-media/abtest.git
synced 2024-12-28 02:46:10 +01:00
Daniel Siepmann
604110e737
We will use and maintain the extension for one of our customers. We add our basic setup. We add tests. We refactor code. We use newer APIs of TYPO3. We will integrate Matomo A/B Testing afterwards as next step.
133 lines
3.2 KiB
YAML
133 lines
3.2 KiB
YAML
name: CI
|
|
|
|
on:
|
|
- pull_request
|
|
|
|
jobs:
|
|
check-composer:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: cachix/install-nix-action@v17
|
|
with:
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
|
|
- name: Validate composer.json
|
|
run: nix-shell --pure --run project-validate-composer
|
|
|
|
php-linting:
|
|
runs-on: ubuntu-20.04
|
|
strategy:
|
|
matrix:
|
|
php-version:
|
|
- 7.4
|
|
- 8.0
|
|
- 8.1
|
|
- 8.2
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Install PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: "${{ matrix.php-version }}"
|
|
coverage: none
|
|
tools: composer:v2
|
|
|
|
- name: PHP lint
|
|
run: "find *.php Classes Configuration Tests -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l"
|
|
|
|
xml-linting:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: cachix/install-nix-action@v17
|
|
with:
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
|
|
- name: Validate XML
|
|
run: nix-shell --pure --run project-validate-xml
|
|
|
|
coding-guideline:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: cachix/install-nix-action@v17
|
|
with:
|
|
nix_path: nixpkgs=channel:nixos-unstable
|
|
|
|
- name: Check Coding Guideline
|
|
run: nix-shell --pure --run project-coding-guideline
|
|
|
|
code-quality:
|
|
runs-on: ubuntu-20.04
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- php-version: '7.4'
|
|
- php-version: '8.0'
|
|
- php-version: '8.1'
|
|
- php-version: '8.2'
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Install PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: "${{ matrix.php-version }}"
|
|
coverage: none
|
|
tools: composer:v2
|
|
|
|
- name: Install dependencies
|
|
run: composer install --no-interaction --prefer-dist --no-progress
|
|
|
|
- name: Code Quality (by PHPStan)
|
|
run: ./vendor/bin/phpstan analyse
|
|
|
|
tests:
|
|
runs-on: ubuntu-20.04
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- php-version: '7.4'
|
|
- php-version: '8.0'
|
|
- php-version: '8.1'
|
|
- php-version: '8.2'
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Install PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: "${{ matrix.php-version }}"
|
|
coverage: none
|
|
tools: composer:v2
|
|
|
|
- name: Setup MySQL
|
|
uses: mirromutth/mysql-action@v1.1
|
|
with:
|
|
mysql version: '8'
|
|
mysql database: 'typo3'
|
|
mysql root password: 'root'
|
|
|
|
- name: Wait for MySQL
|
|
run: |
|
|
while ! mysqladmin ping --host=127.0.0.1 --password=root --silent; do
|
|
sleep 1
|
|
done
|
|
|
|
- name: Install dependencies
|
|
run: composer install --no-interaction --prefer-dist --no-progress
|
|
|
|
- name: PHPUnit Tests
|
|
env:
|
|
typo3DatabaseDriver: "pdo_mysql"
|
|
typo3DatabaseName: "typo3"
|
|
typo3DatabaseHost: "127.0.0.1"
|
|
typo3DatabaseUsername: "root"
|
|
typo3DatabasePassword: "root"
|
|
run: ./vendor/bin/phpunit --testdox
|