Skip to content

Update generated code (#1757) #6027

Update generated code (#1757)

Update generated code (#1757) #6027

Workflow file for this run

name: CI
on:
pull_request: ~
push:
branches:
- master
jobs:
build:
name: Components tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
strategy: ['default']
include:
# Minimum supported dependencies with the oldest PHP version
- php: '7.2'
strategy: 'lowest'
steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: flex
- name: Checkout code
uses: actions/checkout@v3
- name: Initialize tests
run: make initialize -j 4
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer
uses: actions/cache@v3
if: steps.composer-cache.outputs.dir
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ github.sha }}
restore-keys: composer-
- name: Modify composer.json - default
run: |
CURRENT_DIR=$(pwd)
for COMPONENT in $(find src/Service -maxdepth 2 -type f -name phpunit.xml.dist -printf '%h\n' | sort)
do
echo ::group::$COMPONENT
echo "$CURRENT_DIR/$COMPONENT"
cd "$CURRENT_DIR/$COMPONENT"
sed -i -re 's/"require": \{/"repositories": [{"type": "path","url": "..\/..\/Core", "options": {"versions": {"async-aws\/core": "dev-master"}}, "canonical": ${{matrix.strategy != 'lowest' && 'true' || 'false'}} }],"require": \{/' composer.json
composer config minimum-stability dev
composer config prefer-stable true
composer require --dev --no-update symfony/phpunit-bridge
cat composer.json
echo ::endgroup::
done
cd "$CURRENT_DIR"
for COMPONENT in $(find src/Integration -maxdepth 3 -type f -name phpunit.xml.dist -printf '%h\n' | sort)
do
echo ::group::$COMPONENT
echo "$CURRENT_DIR/$COMPONENT"
cd "$CURRENT_DIR/$COMPONENT"
sed -i -re 's/"require": \{/"conflict": \{"phpunit\/phpunit": ">=10.0"\},"require": \{/' composer.json
composer config minimum-stability dev
composer config prefer-stable true
cat composer.json
echo ::endgroup::
done
- name: Download dependencies
env:
PHP_VERSION: ${{ matrix.php }}
# Make sure we don't download awfully old Symfony versions.
SYMFONY_REQUIRE: '>=4.4'
run: |
CURRENT_DIR=$(pwd)
for COMPONENT in $(find src -maxdepth 4 -type f -name phpunit.xml.dist -printf '%h\n' | sort)
do
echo ::group::$COMPONENT
echo "$CURRENT_DIR/$COMPONENT"
cd "$CURRENT_DIR/$COMPONENT"
localExit=0
composer require symfony/phpunit-bridge --no-update --no-install
composer update --no-interaction --no-scripts --prefer-dist --optimize-autoloader ${{ matrix.strategy == 'lowest' && '--prefer-lowest' || '' }} $COMPOSER_OPTIONS || localExit=1
./vendor/bin/simple-phpunit install
echo ::endgroup::
if [ $localExit -ne 0 ]; then
echo "::error::$COMPONENT error"
exit $localExit
fi
done
- name: Run tests
env:
OVERRIDE_SYMFONY_DEPRECATIONS_HELPER: ${{ matrix.strategy == 'lowest' && 'max[self]=9999' || '' }}
run: |
ok=0
if [ -n "$OVERRIDE_SYMFONY_DEPRECATIONS_HELPER" ]; then
export SYMFONY_DEPRECATIONS_HELPER=$OVERRIDE_SYMFONY_DEPRECATIONS_HELPER
fi
CURRENT_DIR=$(pwd)
for COMPONENT in $(find src -maxdepth 4 -type f -name phpunit.xml.dist -printf '%h\n' | sort)
do
echo ::group::$COMPONENT
localExit=0
cd "$CURRENT_DIR/$COMPONENT"
./vendor/bin/simple-phpunit 2>&1 || localExit=1
ok=$(( $localExit || $ok ))
echo ::endgroup::
if [ $localExit -ne 0 ]; then
echo "::error::$COMPONENT failed"
fi
done
exit $ok
root:
name: Root tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
minimum_stability: [dev, stable]
steps:
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: none
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Initialize tests
run: make initialize -j 4
- name: Get composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: composer-${{ github.sha }}
restore-keys: composer-
- name: Download dependencies
run: |
composer config minimum-stability ${{ matrix.minimum_stability }}
composer require --dev --no-update "phpunit/phpunit=9.6.*"
composer update --no-interaction --prefer-dist --optimize-autoloader
- name: Run tests
run: |
echo ::group::Install
./vendor/bin/simple-phpunit install
echo ::endgroup::
./vendor/bin/simple-phpunit