Skip to content

Raise Versions

Raise Versions #2

Workflow file for this run

name: Test
on: [ push, pull_request ]
defaults:
run:
shell: bash
jobs:
Consistency:
name: 'Consistency'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Composer Cache Vars
id: composer-cache-vars
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
echo "timestamp=$(date +"%s")" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache-vars.outputs.dir }}
key: ${{ runner.os }}-composer-^11.5.26-stable-8.1-${{ steps.composer-cache-vars.outputs.timestamp }}
restore-keys: |
${{ runner.os }}-composer-^11.5.26-stable-8.1-
${{ runner.os }}-composer-^11.5.26-stable-
${{ runner.os }}-composer-^11.5.26-
${{ runner.os }}-composer-
- name: Set up PHP Version 8.1
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
tools: composer:v2
coverage: none
- name: "Extract tag, branch, version from GITHUB_REF"
id: "github-ref"
run: |
echo "tag=$(echo $GITHUB_REF | sed -E -n 's#^refs/tags/(.*)$#\1#p')" >> $GITHUB_OUTPUT
echo "branch=$(echo $GITHUB_REF | sed -E -n 's#^refs/heads/(.*)$#\1#p')" >> $GITHUB_OUTPUT
echo "version=$(echo $GITHUB_REF | sed -E -n 's#^refs/tags/v?([0-9]+\.)([0-9]+\.)([0-9]+)#\1\2\3#p')" >> $GITHUB_OUTPUT
- name: Compare tag version with committed version
if: steps.github-ref.outputs.version != ''
run: |
composer set-version $(echo ${{ steps.github-ref.outputs.tag }} | sed s/^v//g)
test -z "$(git diff --shortstat 2> /dev/null | tail -n1)";
- name: Build extension artifact
run: |
composer extension-release
- name: Documentation will render without warnings
run: |
composer docs:test-render
rm -rf Documentation-GENERATED-temp
Tests:
name: 'T3 ${{ matrix.typo3 }} - ${{ matrix.os }} - PHP ${{ matrix.php }} - ${{ matrix.dependency-version }}'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ 'ubuntu-latest' ]
typo3: [ '^11.5.26', '^12.4' ]
php: [ '8.1', '8.2', '8.3' ]
dependency-version: [ lowest, stable ]
experimental: [ false ]
include:
# - os: 'ubuntu-latest'
# php: 8.2
# typo3: dev-main
# dependency-version: stable
# experimental: true
- os: 'windows-latest'
php: '8.2'
typo3: '^12.4'
dependency-version: stable
experimental: false
continue-on-error: ${{ matrix.experimental }}
steps:
- name: Start database server
if: matrix.os == 'ubuntu-latest'
run: sudo /etc/init.d/mysql start
- name: Checkout
uses: actions/checkout@v4
- name: Composer Cache Vars
id: composer-cache-vars
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
echo "timestamp=$(date +"%s")" >> $GITHUB_OUTPUT
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache-vars.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.typo3 }}-${{ matrix.dependency-version }}-${{ matrix.php }}-${{ steps.composer-cache-vars.outputs.timestamp }}
restore-keys: |
${{ runner.os }}-composer-${{ matrix.typo3 }}-${{ matrix.dependency-version }}-${{ matrix.php }}-
${{ runner.os }}-composer-${{ matrix.typo3 }}-${{ matrix.dependency-version }}-
${{ runner.os }}-composer-${{ matrix.typo3 }}-
${{ runner.os }}-composer-
- name: Set up PHP Version ${{ matrix.php }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, intl, pdo_sqlite, pdo_mysql
tools: composer:v2
coverage: none
- name: Environment Check
run: |
php --version
composer --version
- name: Validate composer.json and composer.lock
run: composer validate
- name: Patch latest TYPO3
if: matrix.typo3 == '^12.4' && matrix.dependency-version == 'stable'
run: composer require --dev --no-update gilbertsoft/typo3-core-patches
- name: Install
env:
COMPOSER_ROOT_VERSION: 8.1.1
run: |
composer update --with "typo3/cms-core:${{ matrix.typo3 }}" --prefer-${{ matrix.dependency-version }} --prefer-dist --no-interaction
- name: Patch latest TYPO3 (reset git)
if: matrix.typo3 == '^12.4' && matrix.dependency-version == 'stable'
run: git checkout .
- name: Lint
run: php vendor/bin/parallel-lint --exclude vendor --exclude var --exclude public .
# This fails when command reference is not up to date
- name: Test Command Reference
if: matrix.os == 'ubuntu-latest' && !matrix.experimental
run: |
vendor/bin/typo3 commandreference:render
git diff --exit-code
- name: Test Install (Unix)
if: matrix.os == 'ubuntu-latest' && !matrix.experimental
run: 'php vendor/bin/typo3 install:setup --install-steps-config=Tests/Console/Functional/Fixtures/Install/mysql-install.yaml --no-interaction -vvv'
- name: Test Install (Windows)
if: matrix.os == 'windows-latest' && !matrix.experimental
run: 'php vendor/bin/typo3 install:setup --install-steps-config=Tests/Console/Functional/Fixtures/Install/sqlite-install.yaml --no-interaction -vvv'
- name: Test
if: matrix.os == 'ubuntu-latest' && !matrix.experimental
run: vendor/bin/phpunit
- name: Test - allow failure
if: matrix.experimental
run: vendor/bin/phpunit || true
- name: Test - Windows
if: matrix.os == 'windows-latest'
env:
TYPO3_INSTALL_DB_DRIVER: pdo_sqlite
run: vendor/bin/phpunit