Skip to content

Commit 4776393

Browse files
Mokhtar Tlilisfmok
Mokhtar Tlili
authored andcommitted
update worflow ci to support dependencies checking
1 parent 55f5d70 commit 4776393

File tree

5 files changed

+113
-84
lines changed

5 files changed

+113
-84
lines changed

.github/workflows/ci.yml

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "*.x"
7+
push:
8+
branches:
9+
- "*.x"
10+
11+
jobs:
12+
phpunit:
13+
name: "PHPUnit"
14+
runs-on: "ubuntu-20.04"
15+
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
php-version:
20+
- "8.0"
21+
- "8.1"
22+
dependencies:
23+
- "highest"
24+
stability:
25+
- "stable"
26+
include:
27+
# Tests the lowest set of dependencies
28+
- dependencies: "lowest"
29+
stability: "stable"
30+
php-version: "8.0"
31+
# Tests the highest set of dependencies
32+
- dependencies: "highest"
33+
stability: "dev"
34+
php-version: "8.1"
35+
36+
steps:
37+
- name: "Checkout"
38+
uses: "actions/checkout@v3"
39+
with:
40+
fetch-depth: 2
41+
42+
- name: "Install PHP with PCOV"
43+
uses: "shivammathur/setup-php@v2"
44+
with:
45+
php-version: "${{ matrix.php-version }}"
46+
coverage: "pcov"
47+
48+
- name: "Enforce using stable dependencies"
49+
run: "composer config minimum-stability stable"
50+
if: "${{ matrix.stability == 'stable' }}"
51+
52+
- name: "Install dependencies with Composer"
53+
uses: "ramsey/composer-install@v2"
54+
with:
55+
dependency-versions: "${{ matrix.dependencies }}"
56+
composer-options: "--prefer-dist"
57+
58+
- name: "Run PHPUnit"
59+
run: "vendor/bin/phpunit --coverage-clover=coverage.xml"
60+
61+
- name: "Upload coverage file"
62+
uses: "actions/upload-artifact@v2"
63+
with:
64+
name: "phpunit-${{ matrix.php-version }}-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}.coverage"
65+
path: "coverage.xml"
66+
67+
upload_coverage:
68+
name: "Upload coverage to Codecov"
69+
runs-on: "ubuntu-20.04"
70+
needs:
71+
- "phpunit"
72+
73+
steps:
74+
- name: "Checkout"
75+
uses: "actions/checkout@v3"
76+
with:
77+
fetch-depth: 2
78+
79+
- name: "Download coverage files"
80+
uses: "actions/download-artifact@v2"
81+
with:
82+
path: "reports"
83+
84+
- name: "Upload to Codecov"
85+
uses: "codecov/codecov-action@v1"
86+
with:
87+
directory: reports

.github/workflows/php.yml

-50
This file was deleted.

composer.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@
1919
"license": "MIT",
2020
"require": {
2121
"php": "^8.0",
22-
"symfony/http-kernel": "^4.4 || ^5.0 || ^6.0",
23-
"symfony/http-foundation": "^4.4 || ^5.0 || ^6.0",
24-
"symfony/serializer": "^4.4 || ^5.0 || ^6.0",
25-
"symfony/validator": "^4.4 || ^5.0 || ^6.0",
26-
"symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0",
27-
"symfony/property-access": "^4.4 || ^5.0 || ^6.0"
22+
"symfony/http-kernel": "^5.4 || ^6.0",
23+
"symfony/http-foundation": "^5.4 || ^6.0",
24+
"symfony/serializer": "^5.4 || ^6.0",
25+
"symfony/validator": "^5.4 || ^6.0",
26+
"symfony/dependency-injection": "^5.4 || ^6.0",
27+
"symfony/property-access": "^5.4 || ^6.0"
2828
},
2929
"require-dev": {
3030
"phpunit/phpunit": "^9",
31-
"symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0",
31+
"symfony/framework-bundle": "^5.4 || ^6.0",
3232
"phpspec/prophecy-phpunit": "^2.0",
3333
"friendsofphp/php-cs-fixer": "^3.13",
3434
"phpstan/phpstan": "^1.9"

phpunit.xml

-27
This file was deleted.

phpunit.xml.dist

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit colors="true" bootstrap="vendor/autoload.php">
3+
<testsuites>
4+
<testsuite name="RequestInputBundle for the Symfony Framework">
5+
<directory>./tests</directory>
6+
</testsuite>
7+
</testsuites>
8+
9+
<filter>
10+
<whitelist>
11+
<directory>.</directory>
12+
<exclude>
13+
<directory>./Resources</directory>
14+
<directory>./Tests</directory>
15+
<directory>./vendor</directory>
16+
</exclude>
17+
</whitelist>
18+
</filter>
19+
</phpunit>

0 commit comments

Comments
 (0)