Skip to content

Upmerge 5.0 and adapt CI configuration #73

Upmerge 5.0 and adapt CI configuration

Upmerge 5.0 and adapt CI configuration #73

Workflow file for this run

name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main, '[0-9]+.[0-9]' ]
jobs:
build:
env:
FLOW_TARGET_VERSION: "9.0.x-dev"
FLOW_CONTEXT: Testing
FLOW_FOLDER: ../flow-base-distribution
PACKAGE_FOLDER: redirecthandler-databasestorage
strategy:
matrix:
php-versions: ['8.2', '8.3']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set package branch name
run: echo "PACKAGE_TARGET_VERSION=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_ENV
working-directory: .
- name: Set alias branch name
run: if [ "${PACKAGE_TARGET_VERSION}" == "main" ]; then echo "PACKAGE_BRANCH_ALIAS=dev-main"; else echo "PACKAGE_BRANCH_ALIAS=${PACKAGE_TARGET_VERSION}.x-dev"; fi >> $GITHUB_ENV
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, xml, json, zlib, iconv, intl, pdo_sqlite, mysql
coverage: xdebug #optional
ini-values: opcache.fast_shutdown=0
- name: Update Composer
run: |
sudo composer self-update
composer --version
# Directory permissions for .composer are wrong, so we remove the complete directory
# https://github.com/actions/virtual-environments/issues/824
- name: Delete .composer directory
run: |
sudo rm -rf ~/.composer
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache
key: dependencies-composer-${{ hashFiles('composer.json') }}
- name: Prepare Flow distribution
run: |
git clone https://github.com/neos/flow-base-distribution.git -b "${FLOW_TARGET_VERSION}" "${FLOW_FOLDER}"
cd ${FLOW_FOLDER}
git -C ../${{ env.PACKAGE_FOLDER }} checkout -b build
composer config repositories.package '{ "type": "path", "url": "../${{ env.PACKAGE_FOLDER }}", "options": { "symlink": false } }'
composer require --no-update --no-interaction neos/redirecthandler-databasestorage:"dev-build as ${PACKAGE_BRANCH_ALIAS}"
- name: Install distribution
run: |
cd ${FLOW_FOLDER}
composer install --no-interaction --no-progress
- name: Run Unit tests
run: |
cd ${FLOW_FOLDER}
bin/phpunit --colors -c Build/BuildEssentials/PhpUnit/UnitTests.xml Packages/Application/Neos.RedirectHandler.DatabaseStorage/Tests/Unit
- name: Run Functional tests
run: |
cd ${FLOW_FOLDER}
bin/phpunit --colors -c Build/BuildEssentials/PhpUnit/FunctionalTests.xml Packages/Application/Neos.RedirectHandler.DatabaseStorage/Tests/Functional