Update services.yaml (#65) #116
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: liquetsoft_fias | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
name: Linting and testing (PHP ${{ matrix.php-versions }}, Symfony components ${{ matrix.symfony-components-versions }}) | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
php-versions: ['8.2', '8.3'] | |
symfony-components-versions: ['^5.0', '^6.0', '^7.0'] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
- name: Check PHP Version | |
run: php -v | |
- name: Validate composer.json and composer.lock | |
run: composer validate | |
- name: Set up Symfony components versions | |
run: "sed -i -E \"s#\\\"(symfony/.+)\\\".*:.*\\\"(.+)\\\"#\\\"\\1\\\":\\\"${{ matrix.symfony-components-versions }}\\\"#g\" composer.json" | |
- name: Show composer.json | |
run: cat composer.json | |
- name: Install dependencies | |
run: composer install --prefer-dist --no-progress --no-suggest | |
- name: Run test suite | |
run: composer run-script test | |
- name: Run linters | |
run: composer run-script linter | |
symfony: | |
name: Testing Symfony installation (PHP ${{ matrix.php-versions }}, Symfony ${{ matrix.symfony-versions }}) | |
runs-on: ubuntu-latest | |
env: | |
DB_DATABASE: symfony | |
DB_USERNAME: root | |
DB_PASSWORD: password | |
services: | |
mysql: | |
image: mysql:5.7 | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: false | |
MYSQL_ROOT_PASSWORD: password | |
MYSQL_DATABASE: symfony | |
ports: | |
- 3306/tcp | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
strategy: | |
fail-fast: false | |
matrix: | |
php-versions: ['8.2', '8.3'] | |
symfony-versions: ['5.4', '6.4', '7.1'] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup PHP, with composer and extensions | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-versions }} | |
extensions: mbstring, dom, fileinfo, mysql, curl | |
- name: Start mysql service | |
run: sudo /etc/init.d/mysql start | |
- name: Cache Symfony app | |
id: symfony-app-cache | |
uses: actions/cache@v2 | |
with: | |
path: symfony_app_tmp | |
key: ${{ runner.os }}-symfony-${{ matrix.symfony-versions }}-${{ matrix.php-versions }} | |
- name: Install Symfony app | |
if: steps.symfony-app-cache.outputs.cache-hit != 'true' | |
run: | | |
composer create-project symfony/skeleton:"${{ matrix.symfony-versions }}.*" symfony_app_tmp | |
cd symfony_app_tmp | |
composer require webapp | |
- name: Prepare fresh Symfony app | |
run: | | |
cp -r symfony_app_tmp example_app | |
- name: Branch used | |
id: extract_branch | |
run: | | |
if [[ "${GITHUB_EVENT_NAME}" == "push" ]]; then | |
echo "::set-output name=branch::$(echo ${GITHUB_REF##*/})" | |
elif [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then | |
echo "::set-output name=branch::$(echo $GITHUB_HEAD_REF)" | |
else | |
echo "::set-output name=branch::INVALID_EVENT_BRANCH_UNKNOWN" | |
fi | |
- name: Install FIAS | |
run: | | |
unzip ./Tests/Pipeline/_fixtures/install_AddressObject.zip -d ./example_app/fias-data-install | |
unzip ./Tests/Pipeline/_fixtures/update_AddressObject.zip -d ./example_app/fias-data-update | |
cd example_app | |
composer req "liquetsoft/fias-symfony:dev-${{ steps.extract_branch.outputs.branch }}" -W | |
cp ./../Tests/MockEntities/SymfonyTestAddrObj.php src/Entity/AddrObj.php | |
cp ./../Tests/MockEntities/SymfonyTestFiasVersion.php src/Entity/FiasVersion.php | |
echo "liquetsoft_fias:" > config/packages/liquetsoft_fias.yaml | |
echo " version_manager_entity: App\Entity\FiasVersion" >> config/packages/liquetsoft_fias.yaml | |
echo " entity_bindings:" >> config/packages/liquetsoft_fias.yaml | |
echo " ADDR_OBJ: App\Entity\AddrObj" >> config/packages/liquetsoft_fias.yaml | |
echo "APP_ENV=dev" > .env | |
echo "APP_SECRET=test" >> .env | |
echo "DATABASE_URL=mysql://root:password@127.0.0.1:${{ job.services.mysql.ports['3306'] }}/symfony?serverVersion=5.7" >> .env | |
echo "MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0" >> .env | |
php bin/console cache:clear | |
php bin/console doctrine:schema:create -n | |
- name: Lint container | |
run: | | |
cd example_app | |
php bin/console lint:container | |
- name: Test FIAS | |
run: | | |
cd example_app | |
php bin/console liquetsoft:fias:truncate | |
php bin/console liquetsoft:fias:install_from_folder ./fias-data-install | |
php bin/console liquetsoft:fias:update_from_folder ./fias-data-update |