Test #31
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
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow | |
name: "Test" | |
# | |
# Based on workflows from Composer: | |
# | |
# * https://github.com/composer/composer/blob/2.5.4/.github/workflows/continuous-integration.yml | |
# * https://github.com/composer/installers/blob/v2.2.0/.github/workflows/continuous-integration.yml | |
# | |
on: | |
workflow_dispatch: | |
push: | |
paths-ignore: | |
- 'docs/**' | |
tags-ignore: | |
- '**' | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
tags-ignore: | |
- '**' | |
schedule: | |
# Once weekly on Mondays at 14:00 UTC. | |
# | |
# ┌───────────── minute (0 - 59) | |
# │ ┌────────── hour (0 - 23) | |
# │ │ ┌─────── day of the month (1 - 31) | |
# │ │ │ ┌──── month (1 - 12 or JAN-DEC) | |
# │ │ │ │ ┌─ day of the week (0 - 6 or SUN-SAT) | |
# │ │ │ │ │ | |
- cron: '0 15 * * 1' | |
env: | |
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress --prefer-dist" | |
COMPOSER_UPDATE_FLAGS: "" | |
permissions: | |
contents: read | |
jobs: | |
tests: | |
name: "PHP ${{ matrix.php-version }} / Composer ${{ matrix.composer-version }} / ${{ matrix.os }}" | |
strategy: | |
matrix: | |
php-version: | |
- "7.2" | |
- "7.3" | |
- "7.4" | |
- "8.0" | |
- "8.1" | |
- "8.2" | |
- "8.3" | |
composer-version: | |
- "2.3" | |
- "2.4" | |
- "2.5" | |
- "2.6" | |
os: | |
- "ubuntu-latest" | |
experimental: | |
- false | |
include: | |
- php-version: "8.2" | |
composer-version: "preview" | |
os: "ubuntu-latest" | |
experimental: true | |
- php-version: "8.2" | |
composer-version: "snapshot" | |
os: "ubuntu-latest" | |
experimental: true | |
- php-version: "8.2" | |
composer-version: "v2" | |
os: "windows-latest" | |
experimental: false | |
- php-version: "8.4" | |
composer-version: "v2" | |
os: "ubuntu-latest" | |
experimental: true | |
runs-on: ${{ matrix.os }} | |
continue-on-error: ${{ matrix.experimental }} | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
- name: "Setup PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "none" | |
extensions: "intl, zip" | |
ini-values: "memory_limit=-1, phar.readonly=0, error_reporting=E_ALL, display_errors=On" | |
php-version: "${{ matrix.php-version }}" | |
tools: "composer:${{ matrix.composer-version }}" | |
env: | |
fail-fast: true | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Retrieve Composer cache directory | |
id: composer-cache | |
shell: bash | |
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT | |
- name: "Cache dependencies installed with Composer" | |
uses: actions/cache@v3 | |
with: | |
path: "${{ steps.composer-cache.outputs.dir }}" | |
key: ${{ runner.os }}-composer-${{ matrix.composer-version }}-${{ hashFiles('**/composer.lock') }} | |
restore-keys: ${{ runner.os }}-composer-${{ matrix.composer-version }}- | |
- name: Install Composer dependencies | |
shell: bash | |
run: | | |
# Resolve dependencies according to Composer: ${{ matrix.composer-version }} | |
if [ "${{ matrix.composer-version }}" == "snapshot" ]; then | |
composer config platform --unset | |
composer config minimum-stability dev | |
composer require ${{ env.COMPOSER_FLAGS }} --update-with-dependencies composer/composer="dev-main" | |
elif [ "${{ matrix.composer-version }}" == "preview" ]; then | |
composer config platform --unset | |
composer config minimum-stability alpha | |
composer require ${{ env.COMPOSER_FLAGS }} --update-with-dependencies composer/composer | |
elif [ "${{ matrix.composer-version }}" == "v2" ]; then | |
composer install ${{ env.COMPOSER_FLAGS }} | |
else | |
composer require ${{ env.COMPOSER_FLAGS }} --update-with-dependencies composer/composer="~${{ matrix.composer-version }}.0" | |
fi | |
- name: "Prepare git environment" | |
run: "git config --global user.name composer && git config --global user.email [email protected]" | |
- name: "Run tests" | |
run: "vendor/bin/simple-phpunit --verbose" |