From f687a657964ff3b28370aa3496d6a1148c4b3cca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Tvrd=C3=ADk?= Date: Sat, 19 Dec 2020 13:54:53 +0100 Subject: [PATCH] switch from Travis to GitHub actions (#113) --- .github/workflows/qa.yaml | 68 +++++++++++++++++++ .travis.yml | 41 ----------- ...ationsExtension.diffGenerator.configA.neon | 2 +- ...ationsExtension.diffGenerator.configB.neon | 2 +- tests/drivers.sample.ini | 2 +- 5 files changed, 71 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/qa.yaml delete mode 100644 .travis.yml diff --git a/.github/workflows/qa.yaml b/.github/workflows/qa.yaml new file mode 100644 index 0000000..1200d00 --- /dev/null +++ b/.github/workflows/qa.yaml @@ -0,0 +1,68 @@ +name: QA + +on: + pull_request: + branches: + - master + + push: + branches: + - master + - v* + +jobs: + tests: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] + + name: PHP ${{ matrix.php }} + + services: + postgres: + image: postgres:9.6 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: nextras_migrations_test + ports: + - 5432:5432 + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + + mysql: + image: mysql:5.6 + env: + MYSQL_DATABASE: nextras_migrations_test + MYSQL_ROOT_PASSWORD: root + ports: + - 3306:3306 + options: >- + --health-cmd "mysqladmin ping -ppass" + --health-interval 10s + --health-start-period 10s + --health-timeout 5s + --health-retries 10 + + steps: + - uses: actions/checkout@v2 + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: json, ctype, mysqli, pgsql, pdo_mysql, pdo_pgsql + coverage: none + + - name: Prepare Env + run: | + PHP_DIR=$(php -r 'echo dirname(php_ini_loaded_file());') + cat $PHP_DIR/php.ini $PHP_DIR/conf.d/*.ini > ./tests/php.ini + cp ./tests/drivers.sample.ini ./tests/drivers.ini + composer install --no-interaction --no-progress + + - run: tests/run-unit.sh + - run: tests/run-integration.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 879ad0a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,41 +0,0 @@ -sudo: false -language: php - -services: - - mysql - - postgresql - -jobs: - fast_finish: true - include: - - php: 5.4 - dist: trusty - - php: 5.5 - dist: trusty - - php: 5.6 - dist: xenial - - php: 7.0 - dist: xenial - - php: 7.1 - dist: xenial - - php: 7.2 - dist: xenial - - php: 7.3 - dist: xenial - - php: 7.4 - dist: xenial - -before_script: - - touch ./tests/php.ini - - cp ./tests/drivers.sample.ini ./tests/drivers.ini - - - psql -c 'CREATE DATABASE nextras_migrations_test' -U postgres - - mysql -e 'CREATE DATABASE nextras_migrations_test;' - - mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql - - - composer self-update - - composer install --no-interaction --no-progress - -script: - - ./tests/run-unit.sh - - ./tests/run-integration.sh diff --git a/tests/cases/integration/nette-di/MigrationsExtension.diffGenerator.configA.neon b/tests/cases/integration/nette-di/MigrationsExtension.diffGenerator.configA.neon index a650d99..c0aa7a4 100644 --- a/tests/cases/integration/nette-di/MigrationsExtension.diffGenerator.configA.neon +++ b/tests/cases/integration/nette-di/MigrationsExtension.diffGenerator.configA.neon @@ -8,6 +8,6 @@ migrations: diffGenerator: doctrine services: - - Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration([%doctrineDir%]) + - Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration([%doctrineDir%], true) - Doctrine\DBAL\DriverManager::getConnection(%doctrineConfig%, @Doctrine\ORM\Configuration) - Doctrine\ORM\EntityManager::create(@Doctrine\DBAL\Connection, @Doctrine\ORM\Configuration) diff --git a/tests/cases/integration/nette-di/MigrationsExtension.diffGenerator.configB.neon b/tests/cases/integration/nette-di/MigrationsExtension.diffGenerator.configB.neon index c8abf13..875c018 100644 --- a/tests/cases/integration/nette-di/MigrationsExtension.diffGenerator.configB.neon +++ b/tests/cases/integration/nette-di/MigrationsExtension.diffGenerator.configB.neon @@ -7,6 +7,6 @@ migrations: driver: mysql services: - - Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration([%doctrineDir%]) + - Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration([%doctrineDir%], true) - Doctrine\DBAL\DriverManager::getConnection(%doctrineConfig%, @Doctrine\ORM\Configuration) - Doctrine\ORM\EntityManager::create(@Doctrine\DBAL\Connection, @Doctrine\ORM\Configuration) diff --git a/tests/drivers.sample.ini b/tests/drivers.sample.ini index 40bda2a..5617a87 100644 --- a/tests/drivers.sample.ini +++ b/tests/drivers.sample.ini @@ -2,7 +2,7 @@ host = "127.0.0.1" database = nextras_migrations_test username = root -password = +password = root [pgsql] host = "127.0.0.1"