-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove travis and add github actions
- Loading branch information
Showing
5 changed files
with
112 additions
and
54 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
name: Test application | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
- '[0-9]+.[0-9]+' | ||
|
||
jobs: | ||
test: | ||
name: "Run tests with php ${{ matrix.php-version }} (${{ matrix.database }}, ${{ matrix.phpcr-transport }})" | ||
runs-on: ubuntu-18.04 | ||
|
||
env: | ||
SYMFONY__DATABASE__DRIVER: pdo_mysql | ||
SYMFONY__DATABASE__VERSION: 5.7 | ||
SYMFONY__DATABASE__HOST: 127.0.0.1 | ||
SYMFONY__DATABASE__PORT: 3306 | ||
SYMFONY__DATABASE__NAME: sulu_test | ||
SYMFONY__DATABASE__USER: root | ||
SYMFONY__DATABASE__PASSWORD: root | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- php-version: '7.0' | ||
database: mysql | ||
phpcr-transport: doctrinedbal | ||
# --prefer-lowest would need a fix in sulu/sulu ^1.6 | ||
composer-flags: '--prefer-dist --no-interaction --prefer-stable' | ||
php-extensions: 'mysql, imagick' | ||
tools: 'composer:v1' | ||
phpstan: false | ||
env: | ||
SYMFONY_DEPRECATIONS_HELPER: disabled | ||
|
||
- php-version: '7.4' | ||
database: mysql | ||
phpcr-transport: doctrinedbal | ||
composer-flags: '--prefer-dist --no-interaction' | ||
php-extensions: 'mysql, imagick' | ||
tools: 'composer:v1' | ||
phpstan: true | ||
env: | ||
SYMFONY_DEPRECATIONS_HELPER: weak | ||
|
||
services: | ||
mysql: | ||
image: mysql:5.7 | ||
env: | ||
MYSQL_ROOT_PASSWORD: root | ||
ports: | ||
- 3306:3306 | ||
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=5 | ||
|
||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install and configure PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php-version }} | ||
extensions: ${{ matrix.php-extensions }} | ||
tools: ${{ matrix.tools }} | ||
coverage: none | ||
|
||
- name: Get composer cache directory | ||
id: composer-cache-dir | ||
run: echo "::set-output name=dir::$(composer config cache-files-dir)" | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
id: composer-cache | ||
with: | ||
path: ${{ steps.composer-cache-dir.outputs.dir }} | ||
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-composer- | ||
- name: Require phpstan dependency | ||
if: ${{ matrix.phpstan }} | ||
run: composer require --dev phpstan/phpstan --no-interaction --no-update | ||
|
||
- name: Install dependencies | ||
run: | | ||
composer validate --strict | ||
composer update ${{ matrix.composer-flags }} | ||
- name: Create database | ||
run: | | ||
Tests/app/console doctrine:database:create | ||
Tests/app/console doctrine:schema:update --force | ||
env: ${{ matrix.env }} | ||
|
||
- name: PHPStan | ||
if: ${{ matrix.phpstan }} | ||
run: vendor/bin/phpstan analyse ./ --level 1 -c phpstan.neon | ||
env: ${{ matrix.env }} | ||
|
||
- name: Run tests | ||
run: time vendor/bin/phpunit | ||
env: ${{ matrix.env }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +0,0 @@ | ||
sudo: false | ||
dist: trusty | ||
|
||
language: php | ||
|
||
cache: | ||
directories: | ||
- "$HOME/.composer/cache/files" | ||
|
||
env: | ||
global: | ||
- SYMFONY__DATABASE__VERSION=5.5.39 | ||
|
||
services: | ||
- mysql | ||
|
||
matrix: | ||
include: | ||
- php: 5.5 | ||
env: | ||
- COMPOSER_FLAGS="--prefer-dist --no-interaction" # --prefer-lowest TODO FIXME sulu 1.3 issue | ||
- ENABLE_SWAP=true | ||
- php: 7.3 | ||
env: | ||
- COMPOSER_FLAGS="--prefer-dist --no-interaction" | ||
- CODE_COVERAGE=true | ||
- PHPSTAN=true | ||
|
||
before_install: | ||
- phpenv config-add Tests/travis.php.ini | ||
- | # enable swap | ||
if [[ $ENABLE_SWAP == 'true' ]]; then | ||
sudo fallocate -l 4G /swapfile | ||
sudo chmod 600 /swapfile | ||
sudo mkswap /swapfile | ||
sudo swapon /swapfile | ||
sudo sysctl vm.swappiness=10 | ||
fi | ||
- composer self-update | ||
|
||
install: | ||
- if [[ $PHPSTAN == 'true' ]]; then travis_retry composer require --dev phpstan/phpstan --no-update ; fi | ||
- travis_retry composer update $COMPOSER_FLAGS | ||
- composer validate --strict | ||
- composer info -i | ||
- ./Tests/app/console doctrine:database:create | ||
- ./Tests/app/console doctrine:schema:update --force | ||
|
||
script: | ||
- ./vendor/bin/phpunit | ||
- if [[ $PHPSTAN == 'true' ]]; then ./vendor/bin/phpstan analyse ./ --level 1 -c phpstan.neon ; fi | ||
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
This file was deleted.
Oops, something went wrong.