Skip to content

Running tests from GitHub Actions #194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
root = true

[*]
end_of_line = lf
indent_style = space
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true

[*.{twig,php}]
indent_size = 4

[.yamllint]
indent_size = 4

[composer.json]
indent_size = 4

[Makefile]
indent_style = tab
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.* export-ignore
*.md export-ignore
Tests export-ignore
Makefile export-ignore
phpunit.xml.dist export-ignore
Resources/doc export-ignore
Tests export-ignore
87 changes: 87 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Test

on:
push:
branches:
- 3.x
- master
pull_request:

env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true

jobs:
test:
name: PHP ${{ matrix.php-version }} + ${{ matrix.dependencies }} + ${{ matrix.variant }}

runs-on: ubuntu-latest

continue-on-error: ${{ matrix.allowed-to-fail }}

strategy:
matrix:
php-version:
- '7.2'
- '7.3'
- '7.4'
- '8.0'
dependencies: [highest]
allowed-to-fail: [false]
variant: [normal]
include:
- php-version: '7.2'
dependencies: lowest
allowed-to-fail: false
variant: 'vich/uploader-bundle'
- php-version: '7.3'
dependencies: highest
allowed-to-fail: false
variant: normal
- php-version: '7.4'
dependencies: highest
allowed-to-fail: false
variant: 'symfony/symfony:"4.4.*"'
- php-version: '7.4'
dependencies: highest
allowed-to-fail: false
variant: 'vich/uploader-bundle'
- php-version: '8.0'
dependencies: highest
allowed-to-fail: true
variant: normal

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install PHP with extensions
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: pcov
tools: composer:v2

- name: Add PHPUnit matcher
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Configuration required for PHP 8.0
if: matrix.php-version == '8.0'
run: composer config platform.php 7.4.99

- name: Install variant
if: matrix.variant != 'normal'
run: composer require ${{ matrix.variant }} --no-update

- name: "Install Composer dependencies (${{ matrix.dependencies }})"
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "--prefer-dist --prefer-stable"

- name: Run Tests with "vich/uploader-bundle"
if: matrix.variant == 'vich/uploader-bundle'
run: make test_with_vichuploaderbundle

- name: Run Tests
if: matrix.variant != 'vich/uploader-bundle'
run: make test
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/vendor/
.php_cs.cache
.phpunit.result.cache
/Tests/Functional/cache
/Tests/Functional/logs
/vendor/
composer.lock
phpstan.neon
phpunit.xml
.php_cs.cache
.phpunit.result.cache
48 changes: 0 additions & 48 deletions .travis.yml

This file was deleted.

7 changes: 7 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
extends: default

rules:
document-start: disable
line-length:
max: 120
level: warning
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
bootstrap="Tests/bootstrap.php"
>
<php>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=1" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=3" />
<env name="SYMFONY_PHPUNIT_REMOVE" value="symfony/yaml" />
<env name="SYMFONY_PHPUNIT_VERSION" value="8.5" />
</php>
Expand Down