Skip to content

TASK: Also run tests on version branches #67

TASK: Also run tests on version branches

TASK: Also run tests on version branches #67

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: "8.3"
FLOW_CONTEXT: Testing
FLOW_FOLDER: ../flow-base-distribution
PACKAGE_FOLDER: redirecthandler-databasestorage
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: 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@v1
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_TARGET_VERSION}.x-dev"
- 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/*