Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
163 changes: 44 additions & 119 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,131 +1,56 @@
name: "Main"

on: # yamllint disable-line rule:truthy
on:
pull_request: null
push:
branches:
- "main"

env:
DEFAULT_PHP_VERSION: "8.2"
RUN_ENVIRONMENT: "local"
permissions: {}

jobs:
tests:
name : Tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- '8.2'
- '8.3'
- '8.4'
- '8.5'
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

- name: "Install PHP"
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1
with:
coverage: "none"
php-version: "${{ matrix.php }}"
extensions: 'inotify, pcntl'

- name: "Get Composer cache directory"
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"

- name: "Cache Composer dependencies"
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: php-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: php-${{ matrix.php }}-composer-

- name: "Install dependencies with Composer"
run: composer install --no-interaction --no-progress --prefer-dist

- name: "Run unit tests"
run: "make test-unit ENV=${{ env.RUN_ENVIRONMENT }}"

- name: "Run integration tests"
run: "make test-integration ENV=${{ env.RUN_ENVIRONMENT }}"
uses: TYPO3-Documentation/.github/.github/workflows/reusable-php-tests.yml@main
with:
php-versions: '["8.2", "8.3", "8.4", "8.5"]'
test-unit-command: "make test-unit ENV=local"
test-integration-command: "make test-integration ENV=local"
php-extensions: "inotify, pcntl"

quality:
name: Quality
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

- name: "Install PHP"
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1
with:
coverage: "none"
php-version: "${{ env.DEFAULT_PHP_VERSION }}"
extensions: 'inotify, pcntl'

- name: "Get Composer cache directory"
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"

- name: "Cache Composer dependencies"
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: php-${{ env.DEFAULT_PHP_VERSION }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: php-${{ env.DEFAULT_PHP_VERSION }}-composer-

- name: "Install dependencies with Composer"
run: composer install --no-interaction --no-progress --prefer-dist

- name: "Check for normalized composer.json"
run: "composer normalize --dry-run"

- name: "CGL"
run: "make code-style ENV=${{ env.RUN_ENVIRONMENT }}"

- name: "PHPSTAN"
run: "make phpstan ENV=${{ env.RUN_ENVIRONMENT }}"

- name: "Lint guides.xml configurations"
run: "make test-xml ENV=${{ env.RUN_ENVIRONMENT }}"

- name: "'Documentation' renders without warning'"
run: "make test-docs ENV=${{ env.RUN_ENVIRONMENT }}"

- name: "'Documentation-rendertest' renders without warning'"
run: "make test-rendertest ENV=${{ env.RUN_ENVIRONMENT }}"

monorepo-validate:
name: "Validate monorepo structure"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

- name: "Install PHP"
uses: shivammathur/setup-php@44454db4f0199b8b9685a5d763dc37cbf79108e1
with:
coverage: "none"
php-version: "${{ env.DEFAULT_PHP_VERSION }}"
extensions: 'inotify, pcntl'

- name: "Get Composer cache directory"
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> "$GITHUB_OUTPUT"

- name: "Cache Composer dependencies"
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: php-${{ env.DEFAULT_PHP_VERSION }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: php-${{ env.DEFAULT_PHP_VERSION }}-composer-

- name: "Install dependencies with Composer"
run: composer install --no-interaction --no-progress --prefer-dist

- name: "Validate monorepo"
run: "make test-monorepo ENV=${{ env.RUN_ENVIRONMENT }}"
uses: TYPO3-Documentation/.github/.github/workflows/reusable-php-quality.yml@main
with:
php-version: "8.2"
cs-fixer-command: "make code-style ENV=local"
phpstan-command: "make phpstan ENV=local"
run-xml-lint: true
xml-lint-command: "make test-xml ENV=local"
php-extensions: "inotify, pcntl"

composer-normalize:
uses: TYPO3-Documentation/.github/.github/workflows/reusable-php-command.yml@main
with:
php-version: "8.2"
command: "composer normalize --dry-run"
php-extensions: "inotify, pcntl"

test-docs:
uses: TYPO3-Documentation/.github/.github/workflows/reusable-php-command.yml@main
with:
php-version: "8.2"
command: "make test-docs ENV=local"
php-extensions: "inotify, pcntl"

test-rendertest:
uses: TYPO3-Documentation/.github/.github/workflows/reusable-php-command.yml@main
with:
php-version: "8.2"
command: "make test-rendertest ENV=local"
php-extensions: "inotify, pcntl"

validate-monorepo:
uses: TYPO3-Documentation/.github/.github/workflows/reusable-php-command.yml@main
with:
php-version: "8.2"
command: "make test-monorepo ENV=local"
php-extensions: "inotify, pcntl"