Skip to content

Commit c17d101

Browse files
committed
minor #194 Running tests from GitHub Actions (phansys)
This PR was merged into the 3.x branch. Discussion ---------- |Q |A | |--- |--- | |Branch |3.x| |Bug fix? |no | |New feature? |no | |BC breaks? |no | |Deprecations?|no | |Tests pass? |yes | |Fixed tickets|n/a | |License |MIT | |Doc PR |n/a | Commits ------- 4af68fe Running tests from GitHub Actions 371b357 Allow 3 direct deprecation notices 2f8c800 Remove config for Travis CI 1fd6ef1 Small cleanup in `.gitattributes` and `.gitignore` files 614af47 Add `.editorconfig` and `.yamllint` files
2 parents 6c3e821 + 614af47 commit c17d101

7 files changed

Lines changed: 122 additions & 53 deletions

File tree

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
indent_style = space
6+
charset = utf-8
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
10+
[*.{twig,php}]
11+
indent_size = 4
12+
13+
[.yamllint]
14+
indent_size = 4
15+
16+
[composer.json]
17+
indent_size = 4
18+
19+
[Makefile]
20+
indent_style = tab

.gitattributes

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.* export-ignore
22
*.md export-ignore
3-
Tests export-ignore
3+
Makefile export-ignore
4+
phpunit.xml.dist export-ignore
45
Resources/doc export-ignore
6+
Tests export-ignore

.github/workflows/test.yaml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- 3.x
7+
- master
8+
pull_request:
9+
10+
env:
11+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
12+
13+
jobs:
14+
test:
15+
name: PHP ${{ matrix.php-version }} + ${{ matrix.dependencies }} + ${{ matrix.variant }}
16+
17+
runs-on: ubuntu-latest
18+
19+
continue-on-error: ${{ matrix.allowed-to-fail }}
20+
21+
strategy:
22+
matrix:
23+
php-version:
24+
- '7.2'
25+
- '7.3'
26+
- '7.4'
27+
- '8.0'
28+
dependencies: [highest]
29+
allowed-to-fail: [false]
30+
variant: [normal]
31+
include:
32+
- php-version: '7.2'
33+
dependencies: lowest
34+
allowed-to-fail: false
35+
variant: 'vich/uploader-bundle'
36+
- php-version: '7.3'
37+
dependencies: highest
38+
allowed-to-fail: false
39+
variant: normal
40+
- php-version: '7.4'
41+
dependencies: highest
42+
allowed-to-fail: false
43+
variant: 'symfony/symfony:"4.4.*"'
44+
- php-version: '7.4'
45+
dependencies: highest
46+
allowed-to-fail: false
47+
variant: 'vich/uploader-bundle'
48+
- php-version: '8.0'
49+
dependencies: highest
50+
allowed-to-fail: true
51+
variant: normal
52+
53+
steps:
54+
- name: Checkout
55+
uses: actions/checkout@v2
56+
57+
- name: Install PHP with extensions
58+
uses: shivammathur/setup-php@v2
59+
with:
60+
php-version: ${{ matrix.php-version }}
61+
coverage: pcov
62+
tools: composer:v2
63+
64+
- name: Add PHPUnit matcher
65+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
66+
67+
- name: Configuration required for PHP 8.0
68+
if: matrix.php-version == '8.0'
69+
run: composer config platform.php 7.4.99
70+
71+
- name: Install variant
72+
if: matrix.variant != 'normal'
73+
run: composer require ${{ matrix.variant }} --no-update
74+
75+
- name: "Install Composer dependencies (${{ matrix.dependencies }})"
76+
uses: "ramsey/composer-install@v1"
77+
with:
78+
dependency-versions: "${{ matrix.dependencies }}"
79+
composer-options: "--prefer-dist --prefer-stable"
80+
81+
- name: Run Tests with "vich/uploader-bundle"
82+
if: matrix.variant == 'vich/uploader-bundle'
83+
run: make test_with_vichuploaderbundle
84+
85+
- name: Run Tests
86+
if: matrix.variant != 'vich/uploader-bundle'
87+
run: make test

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
/vendor/
1+
.php_cs.cache
2+
.phpunit.result.cache
23
/Tests/Functional/cache
34
/Tests/Functional/logs
5+
/vendor/
46
composer.lock
7+
phpstan.neon
58
phpunit.xml
6-
.php_cs.cache
7-
.phpunit.result.cache

.travis.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

.yamllint

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extends: default
2+
3+
rules:
4+
document-start: disable
5+
line-length:
6+
max: 120
7+
level: warning

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
bootstrap="Tests/bootstrap.php"
1212
>
1313
<php>
14-
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=1" />
14+
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=3" />
1515
<env name="SYMFONY_PHPUNIT_REMOVE" value="symfony/yaml" />
1616
<env name="SYMFONY_PHPUNIT_VERSION" value="8.5" />
1717
</php>

0 commit comments

Comments
 (0)