Skip to content

Commit 8434dbb

Browse files
committed
ci: add github actions
1 parent 2a88ce1 commit 8434dbb

3 files changed

Lines changed: 71 additions & 17 deletions

File tree

.github/workflows/ci.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: "CI"
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
phpunit:
10+
name: "PHPUnit"
11+
runs-on: "ubuntu-22.04"
12+
13+
strategy:
14+
matrix:
15+
php-version:
16+
- "8.1"
17+
- "8.2"
18+
- "8.3"
19+
dependencies:
20+
- "highest"
21+
include:
22+
- dependencies: "lowest"
23+
php-version: "8.1"
24+
25+
steps:
26+
- name: "Checkout"
27+
uses: "actions/checkout@v4"
28+
with:
29+
fetch-depth: 2
30+
31+
- name: "Install PHP"
32+
uses: "shivammathur/setup-php@v2"
33+
with:
34+
php-version: "${{ matrix.php-version }}"
35+
coverage: "pcov"
36+
ini-values: "zend.assertions=1"
37+
38+
- name: "Install dependencies with Composer"
39+
uses: "ramsey/composer-install@v2"
40+
with:
41+
dependency-versions: "${{ matrix.dependencies }}"
42+
43+
- name: "Run PHPUnit"
44+
run: "vendor/bin/phpunit --coverage-clover=coverage.xml"
45+
46+
- name: "Upload coverage file"
47+
uses: "actions/upload-artifact@v4"
48+
with:
49+
name: "phpunit-${{ matrix.dependencies }}-${{ matrix.php-version }}.coverage"
50+
path: "coverage.xml"
51+
52+
upload_coverage:
53+
name: "Upload coverage to Coveralls"
54+
runs-on: "ubuntu-22.04"
55+
needs:
56+
- "phpunit"
57+
58+
steps:
59+
- name: "Checkout"
60+
uses: "actions/checkout@v4"
61+
with:
62+
fetch-depth: 2
63+
64+
- name: "Download coverage files"
65+
uses: "actions/download-artifact@v4"
66+
with:
67+
path: "reports"
68+
69+
- name: "Upload to Coveralls"
70+
uses: coverallsapp/github-action@v2

.travis.yml

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

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
"ext-bcmath": "*"
1515
},
1616
"require-dev": {
17-
"php-coveralls/php-coveralls": "^2.5",
18-
"phpunit/phpunit": "^9.0"
17+
"phpunit/phpunit": "^9.6"
1918
},
2019
"autoload": {
2120
"psr-4": {

0 commit comments

Comments
 (0)