chore: fix deploy to ter action #97
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: [ push, pull_request ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
typo3: [ ^11.5 ] | |
php: [ '8.0' , '8.1', '8.2' ] | |
exclude: | |
- typo3: ^10.4 | |
php: '8.0' | |
- typo3: ^10.4 | |
php: '8.1' | |
- typo3: ^10.4 | |
php: '8.2' | |
- typo3: ^11.5 | |
php: '7.3' | |
steps: | |
- name: Start database server | |
run: | | |
sudo /etc/init.d/mysql start | |
mysql -u root -proot -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';" | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up PHP Version ${{ matrix.php }} | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php }} | |
tools: composer:v2 | |
- name: Environment Check | |
run: | | |
php --version | |
composer --version | |
- name: Validate composer.json and composer.lock | |
run: composer validate | |
- name: Install dependencies with nimut/typo3-complete:${{ matrix.typo3 }} | |
run: | | |
composer require --dev nimut/typo3-complete:${{ matrix.typo3 }} --no-progress | |
git checkout composer.json | |
ln -nfs .Build/vendor/typo3/cms/typo3 typo3 | |
- name: Lint PHP | |
run: find . -name \*.php ! -path "./.Build/*" ! -path "./scripts/*" ! -path "./typo3_src/*" | parallel --gnu php -d display_errors=stderr -l {} > /dev/null \; | |
- name: check code-style | |
if: matrix.typo3 == '^11.5' && matrix.php == '8.0' | |
run: | | |
composer code-check-pipeline | |
- name: Unit Tests without coverage | |
if: matrix.typo3 != '^11.5' && matrix.php != '8.0' | |
run: composer test:unit | |
- name: Unit Tests with coverage | |
if: matrix.typo3 == '^11.5' && matrix.php == '8.0' | |
run: | | |
cp Tests/Unit/Fixtures/LocalConfiguration.php .Build/Web/typo3conf/LocalConfiguration.php | |
export "UNIT_XML"=.Build/vendor/typo3/testing-framework/Resources/Core/Build/UnitTests.xml | |
.Build/bin/phpunit --whitelist Classes --coverage-clover=unittest-coverage.clover --colors -c $UNIT_XML Tests/Unit | |
- name: Functional Tests without coverage | |
if: matrix.typo3 != '^11.5' && matrix.php != '8.0' | |
run: composer test:functional | |
- name: Functional Tests with coverage | |
if: matrix.typo3 == '^11.5' && matrix.php == '8.0' | |
run: | | |
export "FUNCTIONAL_XML"=.Build/vendor/typo3/testing-framework/Resources/Core/Build/FunctionalTests.xml | |
.Build/bin/phpunit --whitelist Classes --coverage-clover=functional-coverage.clover --colors -c $FUNCTIONAL_XML Tests/Functional | |
env: | |
typo3DatabaseHost: 127.0.0.1 | |
typo3DatabaseName: typo3 | |
typo3DatabasePassword: root | |
typo3DatabaseUsername: root | |
- name: Upload coverage results to Scrutinizer | |
if: matrix.typo3 == '^10.4' && matrix.php == '7.4' | |
run: | | |
wget https://scrutinizer-ci.com/ocular.phar | |
php ocular.phar code-coverage:upload --format=php-clover unittest-coverage.clover | |
php ocular.phar code-coverage:upload --format=php-clover functional-coverage.clover |