diff --git a/.github/workflows/test-application.yaml b/.github/workflows/test-application.yaml new file mode 100644 index 00000000..5227c3df --- /dev/null +++ b/.github/workflows/test-application.yaml @@ -0,0 +1,80 @@ +name: Test application + +on: + pull_request: + push: + branches: + - '[0-9]+.[0-9]+' + - '[0-9]+.x' + +jobs: + test: + name: "Test and build with php ${{ matrix.php-version }}" + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + include: + - php-version: '5.5' + php-extensions: 'ctype, iconv, mysql, gd' + tools: 'composer:v1' + + - php-version: '7.4' + php-extensions: 'ctype, iconv, mysql, imagick' + tools: 'composer:v2' + + services: + mysql: + image: mysql:5.5 + env: + MYSQL_ALLOW_EMPTY_PASSWORD: yes + 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.json', 'composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + + - name: Install dependencies + run: | + composer validate + composer update --prefer-dist --no-interaction + + - name: Create database + run: | + bin/adminconsole doctrine:database:create + bin/adminconsole doctrine:database:create --env test + + - name: Build sulu + run: bin/adminconsole sulu:build dev --no-interaction + + - name: Lint code + run: | + bin/adminconsole lint:twig app/Resources/views + bin/adminconsole lint:yaml app/config + + - name: Execute test cases + run: bin/simple-phpunit diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0eaecdfa..00000000 --- a/.travis.yml +++ /dev/null @@ -1,49 +0,0 @@ -sudo: false - -dist: trusty -language: php - -cache: - directories: - - "$HOME/.composer/cache/files" - -matrix: - include: - - php: 5.5 - env: - - COMPOSER_FLAGS="--prefer-dist --no-interaction" - - ENABLE_SWAP=true - - php: 7.1 - env: - - COMPOSER_FLAGS="--prefer-dist --no-interaction" - -before_install: - - composer self-update - - phpenv config-add tests/travis.php.ini - -install: - - | # 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 - # Install dependencies - - travis_retry composer update $COMPOSER_FLAGS - - composer info -i - # Create database for build test - - bin/adminconsole doctrine:database:create - # Create database for unit test - - bin/adminconsole doctrine:database:create --env=test - -script: - # Test if installation works - - bin/adminconsole sulu:build dev --no-interaction - # Lint Twig files - - bin/adminconsole lint:twig app/Resources/views - # Lint Yaml files - - bin/adminconsole lint:yaml app/config - # Test if PHPUnit installation works - - bin/simple-phpunit diff --git a/README.md b/README.md index e710d348..b94f5f18 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,7 @@ [![GitHub license](https://img.shields.io/github/license/sulu/sulu-minimal.svg)](https://github.com/sulu/sulu-minimal/blob/1.6/LICENSE) [![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/sulu/sulu-minimal.svg)](https://github.com/sulu/sulu-minimal/releases) -[![GitHub tag (latest by date)](https://img.shields.io/github/tag-date/sulu/sulu-minimal.svg)](https://github.com/sulu/sulu-minimal/releases) -[![Travis](https://travis-ci.org/sulu/sulu-minimal.png?branch=1.6)](https://travis-ci.org/sulu/sulu-minimal) +[![Test workflow status](https://img.shields.io/github/workflow/status/sulu/sulu-minimal/Test%20Application/1.6?label=test-workflow)](https://github.com/sulu/sulu-minimal/actions) Welcome to the Sulu Minimal Edition - the skeleton to start a new [Sulu](https://github.com/sulu/sulu) project. diff --git a/tests/travis.php.ini b/tests/travis.php.ini deleted file mode 100644 index 7999e961..00000000 --- a/tests/travis.php.ini +++ /dev/null @@ -1 +0,0 @@ -memory_limit = -1