TASK: Also run tests on version branches #60
Workflow file for this run
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: | |
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 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- 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} | |
composer require --no-update --no-interaction neos/redirecthandler-databasestorage:"dev-build as dev-${PACKAGE_TARGET_VERSION}.x-dev" | |
- name: Install distribution | |
run: | | |
cd ${FLOW_FOLDER} | |
composer install --no-interaction --no-progress | |
rm -rf Packages/Application/Neos.RedirectHandler.DatabaseStorage | |
cp -r ../redirecthandler-databasestorage Packages/Application/Neos.RedirectHandler.DatabaseStorage | |
- 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/* |