Skip to content

Commit 38ac7d5

Browse files
authored
Create continuous-integration.yml
1 parent 1dbb0ad commit 38ac7d5

File tree

1 file changed

+94
-0
lines changed

1 file changed

+94
-0
lines changed
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: "Continuous Integration"
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "*.x"
7+
- "main"
8+
push:
9+
branches:
10+
- "*.x"
11+
- "main"
12+
13+
jobs:
14+
phpunit:
15+
name: "PHPUnit"
16+
runs-on: "ubuntu-20.04"
17+
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
php-version:
22+
- "8.0"
23+
- "8.1"
24+
dependencies:
25+
- "highest"
26+
optional-dependencies:
27+
- true
28+
- false
29+
include:
30+
- php-version: "8.0"
31+
dependencies: "lowest"
32+
optional-dependencies: false
33+
- php-version: "8.0"
34+
dependencies: "lowest"
35+
optional-dependencies: true
36+
37+
steps:
38+
- name: "Checkout"
39+
uses: "actions/checkout@v2"
40+
with:
41+
fetch-depth: 2
42+
43+
- name: "Install PHP"
44+
uses: "shivammathur/setup-php@v2"
45+
with:
46+
php-version: "${{ matrix.php-version }}"
47+
coverage: "pcov"
48+
ini-values: "zend.assertions=1"
49+
extensions: "pdo_mysql"
50+
51+
- name: "Install dependencies with Composer"
52+
uses: "ramsey/composer-install@v1"
53+
if: "! startsWith(matrix.php-version, '8')"
54+
with:
55+
dependency-versions: "${{ matrix.dependencies }}"
56+
composer-options: "--prefer-dist --no-suggest"
57+
58+
- name: "Install dependencies with Composer (--ignore-platform-req=php)"
59+
uses: "ramsey/composer-install@v1"
60+
if: "startsWith(matrix.php-version, '8')"
61+
with:
62+
dependency-versions: "${{ matrix.dependencies }}"
63+
composer-options: "--prefer-dist --no-suggest --ignore-platform-req=php"
64+
65+
- name: "Run PHPUnit"
66+
run: "vendor/bin/phpunit --coverage-clover=coverage.xml"
67+
68+
- name: "Upload coverage file"
69+
uses: "actions/upload-artifact@v2"
70+
with:
71+
name: "phpunit-${{ matrix.php-version }}-${{ matrix.dependencies }}-${{ matrix.dbal-version }}.coverage"
72+
path: "coverage.xml"
73+
74+
upload_coverage:
75+
name: "Upload coverage to Codecov"
76+
runs-on: "ubuntu-20.04"
77+
needs:
78+
- "phpunit"
79+
80+
steps:
81+
- name: "Checkout"
82+
uses: "actions/checkout@v2"
83+
with:
84+
fetch-depth: 2
85+
86+
- name: "Download coverage files"
87+
uses: "actions/download-artifact@v2"
88+
with:
89+
path: "reports"
90+
91+
- name: "Upload to Codecov"
92+
uses: "codecov/codecov-action@v2"
93+
with:
94+
directory: "reports"

0 commit comments

Comments
 (0)