Support asset repo type and any repository without composer.json file #374
Workflow file for this run
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: "Run Tests" | |
on: | |
push: | |
paths: | |
- 'src/**' | |
- 'tests/**' | |
- 'templates/**' | |
- 'config/**' | |
- 'composer.lock' | |
branches: | |
- master | |
pull_request: | |
workflow_dispatch: | |
permissions: | |
contents: read | |
env: | |
APP_ENV: test | |
jobs: | |
tests: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- php: '8.1' | |
driver: 'SQLITE' | |
redis: 6 | |
symfony: '6.4.*' | |
- php: '8.2' | |
driver: 'PGSQL' | |
redis: 6 | |
symfony: '6.4.*' | |
- php: '8.3' | |
driver: 'MYSQL' | |
redis: 6 | |
symfony: '6.4.*' | |
- php: '8.4' | |
driver: 'SQLITE' | |
redis: 7 | |
symfony: '7.1.*' | |
composer_flags: '--ignore-platform-reqs' | |
name: PHP ${{ matrix.php }} ${{ matrix.driver }} SF ${{ matrix.symfony }} | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
- name: "Install PHP" | |
uses: "shivammathur/setup-php@v2" | |
with: | |
coverage: "none" | |
extensions: "curl, pdo, pdo_sqlite, pdo_mysql, pdo_pgsql, sqlite, zip, redis" | |
php-version: ${{ matrix.php }} | |
tools: composer | |
- name: "Install Postgres" | |
if: ${{ matrix.driver=='PGSQL' }} | |
uses: harmon758/postgresql-action@v1 | |
with: | |
postgresql version: '14' | |
postgresql password: '123456' | |
postgresql db: 'packeton' | |
- name: "Install MySql" | |
if: ${{ matrix.driver=='MYSQL' }} | |
uses: mirromutth/mysql-action@v1.1 | |
with: | |
mysql version: '8.0' | |
mysql database: 'packeton' | |
mysql root password: '123456' | |
- name: "Install dependencies" | |
run: | | |
set -x | |
echo $DATABASE_URL | |
if [[ "${{ matrix.symfony }}" != "6.4.*" ]]; then | |
export SYMFONY_REQUIRE="${{ matrix.symfony }}" | |
composer update --ansi --no-interaction ${{ matrix.composer_flags }} | |
else | |
composer install --ansi --no-interaction ${{ matrix.composer_flags }} | |
fi | |
- name: Start Redis | |
uses: "supercharge/redis-github-action@1.8.0" | |
with: | |
redis-version: ${{ matrix.redis }} | |
- name: "Prepare Postgres" | |
if: ${{ matrix.driver=='PGSQL' }} | |
run: | | |
set -x | |
echo 'DATABASE_URL="postgresql://postgres:123456@127.0.0.1/packeton?serverVersion=14.0&charset=utf8"' >> .env.test; | |
bin/console doctrine:schema:update --force --complete | |
gunzip -c tests/dump/test.db.gz > tests/dump/test.db | |
php tests/import_db.php sqlite:////${PWD}/tests/dump/test.db postgresql://postgres:123456@127.0.0.1/packeton | |
- name: "Prepare MySql" | |
if: ${{ matrix.driver=='MYSQL' }} | |
run: | | |
set -x | |
echo 'DATABASE_URL="mysql://root:123456@127.0.0.1/packeton?serverVersion=8.0&charset=utf8mb4"' >> .env.test; | |
bin/console doctrine:schema:update --force --complete | |
gunzip -c tests/dump/test.db.gz > tests/dump/test.db | |
php tests/import_db.php sqlite:////${PWD}/tests/dump/test.db mysql://root:123456@127.0.0.1:3306/packeton | |
- name: "Run tests" | |
run: "composer tests" |