[TASK] Use the Composer OAuth token for the seminars early access #1016
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: CI | |
on: | |
push: | |
jobs: | |
php-lint: | |
name: "PHP linter" | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: "Install PHP" | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "${{ matrix.php-version }}" | |
ini-file: development | |
coverage: none | |
tools: composer:v2.6 | |
- name: "Show Composer version" | |
run: composer --version | |
- name: "Show the Composer configuration" | |
run: composer config --global --list | |
- name: "Run PHP lint" | |
run: "composer ci:php:lint" | |
strategy: | |
fail-fast: false | |
matrix: | |
php-version: | |
- '8.1' | |
- '8.2' | |
- '8.3' | |
composer-validate: | |
name: "Composer validate" | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: "Install PHP" | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "${{ matrix.php-version }}" | |
ini-file: development | |
coverage: none | |
tools: composer:v2.6 | |
- name: "Validate the composer.json" | |
run: "composer validate" | |
strategy: | |
fail-fast: false | |
matrix: | |
php-version: | |
- '8.1' | |
- '8.2' | |
- '8.3' | |
code-quality: | |
name: "Code quality checks" | |
runs-on: ubuntu-24.04 | |
needs: composer-validate | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: "Install PHP" | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "${{ matrix.php-version }}" | |
ini-file: development | |
coverage: none | |
tools: composer:v2.6 | |
- name: "Show Composer version" | |
run: composer --version | |
- name: Add the OAuth token | |
run: composer config --global github-oauth.github.com ${{ secrets.COMPOSER_OAUTH }} | |
- name: "Show the Composer configuration" | |
run: composer config --global --list | |
- name: "Cache dependencies installed with composer" | |
uses: actions/cache@v4 | |
with: | |
key: "php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}" | |
path: ~/.cache/composer | |
restore-keys: "php${{ matrix.php-version }}-composer-\n" | |
- name: "Install Composer dependencies" | |
run: "composer update --no-progress" | |
- name: "Run command" | |
run: "composer ci:${{ matrix.command }}" | |
strategy: | |
fail-fast: false | |
matrix: | |
command: | |
- composer:normalize | |
- json:lint | |
- yaml:lint | |
- php:cs-fixer | |
- php:stan | |
- typoscript:lint | |
php-version: | |
- '8.3' | |
rector: | |
name: Rector | |
runs-on: ubuntu-24.04 | |
needs: [ php-lint ] | |
timeout-minutes: 2 | |
strategy: | |
matrix: | |
php-version: | |
- '8.3' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
ini-file: development | |
coverage: none | |
tools: composer:v2 | |
- name: Show Composer version | |
run: composer --version | |
- name: Add the OAuth token | |
run: composer config --global github-oauth.github.com ${{ secrets.COMPOSER_OAUTH }} | |
- name: Show the Composer configuration | |
run: composer config --global --list | |
- name: Cache dependencies installed with Composer | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/composer | |
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.lock') }} | |
restore-keys: | | |
php${{ matrix.php-version }}-composer- | |
- name: Install Composer dependencies | |
run: composer update --no-progress | |
- name: Run Rector | |
run: vendor/bin/rector --dry-run --no-progress-bar | |
unit-tests: | |
name: Unit Tests | |
runs-on: ubuntu-24.04 | |
needs: [ php-lint ] | |
strategy: | |
matrix: | |
php-version: | |
- '8.1' | |
- '8.2' | |
- '8.3' | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: "Install PHP" | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "${{ matrix.php-version }}" | |
ini-file: development | |
coverage: none | |
tools: composer:v2.6 | |
- name: "Show Composer version" | |
run: composer --version | |
- name: Add the OAuth token | |
run: composer config --global github-oauth.github.com ${{ secrets.COMPOSER_OAUTH }} | |
- name: "Show the Composer configuration" | |
run: composer config --global --list | |
- name: "Cache dependencies installed with composer" | |
uses: actions/cache@v4 | |
with: | |
key: "php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}" | |
path: ~/.cache/composer | |
restore-keys: "php${{ matrix.php-version }}-composer-\n" | |
- name: "Install Composer dependencies" | |
run: "composer update --no-progress" | |
- name: "Run the tests" | |
run: "composer ci:tests:unit" | |
functional-tests: | |
name: Functional Tests | |
runs-on: ubuntu-24.04 | |
needs: [ php-lint, composer-validate ] | |
strategy: | |
matrix: | |
php-version: | |
- '8.1' | |
- '8.2' | |
- '8.3' | |
env: | |
DB_DATABASE: typo3 | |
DB_USER: root | |
DB_PASSWORD: root | |
DB_HOST: 127.0.0.1 | |
steps: | |
- name: "Checkout" | |
uses: actions/checkout@v4 | |
- name: "Install PHP" | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: "${{ matrix.php-version }}" | |
ini-file: development | |
coverage: none | |
tools: composer:v2.6 | |
- name: "Show Composer version" | |
run: composer --version | |
- name: Add the OAuth token | |
run: composer config --global github-oauth.github.com ${{ secrets.COMPOSER_OAUTH }} | |
- name: "Show the Composer configuration" | |
run: composer config --global --list | |
- name: "Cache dependencies installed with composer" | |
uses: actions/cache@v4 | |
with: | |
key: "php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}" | |
path: ~/.cache/composer | |
restore-keys: "php${{ matrix.php-version }}-composer-\n" | |
- name: "Install Composer dependencies" | |
run: "composer update --no-progress" | |
- name: "Start MySQL" | |
run: "sudo /etc/init.d/mysql start" | |
- name: "Run the tests" | |
run: | | |
export typo3DatabaseName="$DB_DATABASE"; | |
export typo3DatabaseHost="$DB_HOST"; | |
export typo3DatabaseUsername="$DB_USER"; | |
export typo3DatabasePassword="$DB_PASSWORD"; | |
composer ci:tests:functional |