Skip to content

Commit e959fb8

Browse files
authored
ci: add github actions (#1)
1 parent e4e0f8a commit e959fb8

3 files changed

Lines changed: 70 additions & 17 deletions

File tree

.github/workflows/ci.yml

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