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 7a2e85b commit e26a3a3
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 54 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.gitattributes export-ignore
.gitignore export-ignore
.styleci.yml export-ignore
.travis.yml export-ignore
CHANGELOG.md export-ignore
Gruntfile.js export-ignore
package.json export-ignore
Expand Down
105 changes: 105 additions & 0 deletions .github/workflows/test-application.yaml
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 }}
51 changes: 0 additions & 51 deletions .travis.yml
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
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# Sulu Form Bundle

<p align="center">

[![GitHub license](https://img.shields.io/github/license/sulu/SuluFormBundle.svg)](https://github.com/sulu/SuluFormBundle/blob/develop/LICENSE)
[![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/sulu/SuluFormBundle.svg)](https://github.com/sulu/SuluFormBundle/releases)
[![GitHub tag (latest by date)](https://img.shields.io/github/tag-date/sulu/SuluFormBundle.svg)](https://github.com/sulu/SuluFormBundle/releases)
[![Travis](https://travis-ci.org/sulu/SuluFormBundle.png?branch=master)](https://travis-ci.org/sulu/SuluFormBundle)
<a href="https://github.com/sulu/SuluFormBundle/actions" target="_blank">
<img src="https://img.shields.io/github/workflow/status/sulu/SuluFormBundle/Test%20application/master.svg?label=github-actions" alt="GitHub actions status">
</a>
[![Packagist](https://img.shields.io/packagist/dt/sulu/sulu-form-bundle.svg)](https://packagist.org/packages/sulu/sulu-form-bundle)

</p>

The SuluFormBundle adds support for creating dynamic forms in Sulu. It can
be used for contact, sweepstake or other forms.

Expand Down
1 change: 0 additions & 1 deletion Tests/travis.php.ini

This file was deleted.

0 comments on commit e26a3a3

Please sign in to comment.