Skip to content

v2.1

v2.1 #80

Workflow file for this run

name: CI
on: [pull_request]
jobs:
tests:
name: YaEtl CI (PHP ${{ matrix.php-versions }} / console ${{ matrix.console-versions }})
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ '8.3', '8.2', '8.1', '8.0', '7.4', '7.3', '7.2' ]
console-versions: ['7.1', '7.0', '6.2', '6.0', '5.4', '5.3', '5.2', '5.1', '5.0', '4.4', '4.3', '4.2', '4.1', '4.0', '3.4']
exclude:
- php-versions: 8.3
console-versions: 4.3
- php-versions: 8.3
console-versions: 4.2
- php-versions: 8.3
console-versions: 4.1
- php-versions: 8.3
console-versions: 4.0
- php-versions: 8.3
console-versions: 3.4
- php-versions: 8.2
console-versions: 4.3
- php-versions: 8.2
console-versions: 4.2
- php-versions: 8.2
console-versions: 4.1
- php-versions: 8.2
console-versions: 4.0
- php-versions: 8.2
console-versions: 3.4
- php-versions: 8.1
console-versions: 4.3
- php-versions: 8.1
console-versions: 4.2
- php-versions: 8.1
console-versions: 4.1
- php-versions: 8.1
console-versions: 4.0
- php-versions: 8.1
console-versions: 3.4
- php-versions: 8.0
console-versions: 6.2
- php-versions: 8.0
console-versions: 6.1
- php-versions: 8.0
console-versions: 4.3
- php-versions: 8.0
console-versions: 4.2
- php-versions: 8.0
console-versions: 4.1
- php-versions: 8.0
console-versions: 4.0
- php-versions: 8.0
console-versions: 3.4
- php-versions: 7.4
console-versions: 7.1
- php-versions: 7.4
console-versions: 7.0
- php-versions: 7.4
console-versions: 6.2
- php-versions: 7.4
console-versions: 6.1
- php-versions: 7.4
console-versions: 6.0
- php-versions: 7.3
console-versions: 6.2
- php-versions: 7.3
console-versions: 6.1
- php-versions: 7.3
console-versions: 6.0
- php-versions: 7.2
console-versions: 6.2
- php-versions: 7.2
console-versions: 6.1
- php-versions: 7.2
console-versions: 6.0
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, dom, fileinfo, gmp, bcmath
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: Remove composer.lock
run: rm -f composer.lock
- name: Detect Orchestra compatibility with console ${{ matrix.console-versions }}
id: orchestra-compat
run: |
if [[ " 3.4 4.0 4.1 4.2 " =~ " ${{ matrix.console-versions }} " ]]; then
echo '::set-output name=compat::0'
exit 0
fi
if [[ " 8.0 8.1 8.2 8.3 " =~ " ${{ matrix.php-versions }} " ]]; then
if [[ " 4.4 4.3 " =~ " ${{ matrix.console-versions }} " ]]; then
echo '::set-output name=compat::0'
exit 0
fi
fi
echo '::set-output name=compat::1'
shell: bash
- name: Remove Orchestra if incompatible with console ${{ matrix.console-versions }}
run: composer remove "orchestra/testbench" --dev --no-update
if: ${{ steps.orchestra-compat.outputs.compat == 0 }}
- name: Remove php-cs-fixer dependency
run: composer remove "friendsofphp/php-cs-fixer" --dev --no-update
- name: Install Symfony console ${{ matrix.console-versions }}
run: composer require "symfony/console:^${{ matrix.console-versions }}" --dev --no-update
- name: Install Composer dependencies
run: composer install --no-progress --prefer-dist --optimize-autoloader
- name: Lib test with phpunit
run: vendor/bin/phpunit --testsuite Lib
- name: Laravel test with phpunit
run: vendor/bin/phpunit --testsuite Laravel
if: ${{ steps.orchestra-compat.outputs.compat == 1 }}