Skip to content

Merge pull request #65 from KarlsonComplete/fix/auth-token-expiry-emp… #262

Merge pull request #65 from KarlsonComplete/fix/auth-token-expiry-emp…

Merge pull request #65 from KarlsonComplete/fix/auth-token-expiry-emp… #262

name: "Functional tests"
on:
push:
pull_request:
env:
COMPOSER_FLAGS: "--ansi --no-interaction --no-progress"
DATABASE_HOST: localhost
DATABASE_USER: b24phpLibTest
DATABASE_PASSWORD: b24phpLibTest
DATABASE_NAME: b24phpLibTest
jobs:
tests:
name: "Functional tests"
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
php-version:
- "8.3"
dependencies: [ highest ]
operating-system: [ ubuntu-latest ]
services:
bitrix24-php-lib-test-database:
image: postgres:16-alpine
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U b24phpLibTest"
--health-interval=10s
--health-timeout=5s
--health-retries=5
env:
POSTGRES_USER: b24phpLibTest
POSTGRES_PASSWORD: b24phpLibTest
POSTGRES_DB: b24phpLibTest
steps:
- name: "Checkout code"
uses: "actions/checkout@v2"
- name: "Setup PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
php-version: "${{ matrix.php-version }}"
extensions: json, bcmath, curl, intl, mbstring, pdo_pgsql, pdo
- name: "Install dependencies with Composer"
run: |
composer update ${{ env.COMPOSER_FLAGS }}
- name: "Install PostgreSQL client"
run: |
sudo apt-get update
sudo apt-get install -y postgresql-client
- name: "Wait for PostgreSQL to be ready"
run: |
until pg_isready -h localhost -p 5432 -U b24phpLibTest; do
echo "Waiting for PostgreSQL to start..."
sleep 2
done
- name: "Run functional tests"
run: |
php bin/doctrine orm:schema-tool:drop --force
php bin/doctrine orm:schema-tool:create --dump-sql
php bin/doctrine orm:schema-tool:update --force
php bin/doctrine orm:info
# Запуск тестов с очисткой состояния между тестами
php vendor/bin/phpunit --testsuite=functional_tests --display-warnings --testdox --process-isolation
- name: "is functional tests succeeded"
if: ${{ success() }}
run: |
echo '✅ functional tests pass, congratulations!'
- name: "is functional tests failed"
if: ${{ failure() }}
run: |
echo '::error:: ❗️ functional tests failed (╯°益°)╯彡┻━┻'