Skip to content

Commit

Permalink
Remove travis and add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Prokyonn committed Dec 22, 2020
1 parent 2cfc3a7 commit 6bab22f
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 30 deletions.
94 changes: 94 additions & 0 deletions .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Test application

on:
pull_request:
push:
branches:
- master
- develop
- '[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__PHPCR__TRANSPORT: doctrinedbal
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: '5.5'
database: postgres
phpcr-transport: doctrinedbal
composer-flags: '--prefer-lowest --prefer-dist --no-interaction'
php-extensions: 'mysql, gd'
tools: 'composer:v1'
env:
SYMFONY__DEPRECATIONS__HELPER: disabled
- php-version: '7.0'
database: mysql
phpcr-transport: doctrinedbal
composer-flags: '--prefer-dist --no-interaction'
php-extensions: 'mysql, gd'
tools: 'composer:v2'
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: 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: Run tests
run: time vendor/bin/phpunit
env: ${{ matrix.env }}
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

2 changes: 0 additions & 2 deletions Tests/travis.php.ini

This file was deleted.

1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
},
"require-dev": {
"phpunit/phpunit": "~4.8 || ~5.0",
"doctrine/data-fixtures": "^1.1",
"symfony/monolog-bundle": "~2.4",
"jackalope/jackalope-doctrine-dbal": "~1.2",
"zendframework/zendsearch": "2.*@RC"
Expand Down

0 comments on commit 6bab22f

Please sign in to comment.