Skip to content

Commit 371d3e0

Browse files
committed
Use GitHub actions.
1 parent 8185b3a commit 371d3e0

File tree

7 files changed

+63
-45
lines changed

7 files changed

+63
-45
lines changed

.gitattributes

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/.gitattributes export-ignore
22
/.gitignore export-ignore
3-
/.scrutinizer.yml export-ignore
4-
/.travis.yml export-ignore
53
/build.xml export-ignore
64
/phpunit.xml export-ignore
75
/README.md export-ignore

.github/workflows/unit.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
on:
2+
- "pull_request"
3+
- "push"
4+
5+
name: "unit"
6+
7+
permissions:
8+
contents: "read"
9+
10+
jobs:
11+
tests:
12+
name: "Tests"
13+
runs-on: "ubuntu-latest"
14+
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
php-version:
19+
- "7.4"
20+
- "8.1"
21+
- "8.2"
22+
- "8.3"
23+
24+
steps:
25+
- name: "Checkout"
26+
uses: "actions/checkout@v3"
27+
28+
- name: "Install PHP with extensions"
29+
uses: "shivammathur/setup-php@v2"
30+
with:
31+
php-version: "${{ matrix.php-version }}"
32+
php_extensions: "xdebug"
33+
34+
- name: "Cache dependencies installed with Composer"
35+
uses: "actions/cache@v2"
36+
with:
37+
path: "~/.composer/cache"
38+
key: "php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }}"
39+
restore-keys: "php${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"
40+
41+
- name: "Install dependencies with Composer"
42+
run: "composer update --no-ansi --no-interaction --no-progress"
43+
44+
- name: "Run tests with PHPUnit"
45+
run: "bin/phing unit"
46+
47+
- name: "Upload to Codecov"
48+
uses: "codecov/codecov-action@v2"
49+
with:
50+
files: "test/coverage.xml"
51+
verbose: true

.scrutinizer.yml

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

.travis.yml

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

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
<a href="https://packagist.org/packages/setbased/exception"><img src="https://poser.pugx.org/setbased/exception/v/stable" alt="Latest Stable Version"/></a><br/>
2323
</td>
2424
<td>
25-
<a href="https://travis-ci.org/SetBased/php-exception"><img src="https://travis-ci.org/SetBased/php-exception.svg?branch=master" alt="Build Status"/></a><br/>
26-
<a href="https://scrutinizer-ci.com/g/SetBased/php-exception/?branch=master"><img src="https://scrutinizer-ci.com/g/SetBased/php-exception/badges/coverage.png?b=master" alt="Code Coverage"/></a>
25+
<a href="https://github.com/SetBased/php-exception/actions/workflows/unit.yml"><img src="https://github.com/SetBased/php-exception/actions/workflows/unit.yml/badge.svg" alt="Build Status"/></a><br/>
26+
<a href="https://codecov.io/gh/SetBased/php-exception"><img src="https://codecov.io/gh/SetBased/php-exception/branch/master/graph/badge.svg" alt="Code Coverage"/></a>
2727
</td>
2828
<td>
2929
<a href="https://scrutinizer-ci.com/g/SetBased/php-exception/?branch=master"><img src="https://scrutinizer-ci.com/g/SetBased/php-exception/badges/quality-score.png?b=master" alt="Scrutinizer Code Quality"/></a>

build.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project name="php-exception" default="build" basedir=".">
3-
<target name="build">
4-
</target>
5-
63
<!-- Run composer update -->
74
<target name="update">
85
<exec executable="composer" checkreturn="true" passthru="true">
@@ -20,6 +17,8 @@
2017

2118
<!-- Runs all unit tests -->
2219
<target name="unit">
23-
<exec command="bin/phpunit" passthru="true" checkreturn="true"/>
20+
<exec executable="bin/phpunit" passthru="true" checkreturn="true"/>
2421
</target>
22+
23+
<target name="build" depends="update,unit"/>
2524
</project>

composer.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
"require": {
1010
"php": ">=7.4"
1111
},
12+
"minimum-stability": "dev",
13+
"prefer-stable": true,
1214
"require-dev": {
13-
"phing/phing": "^2.16.3",
15+
"phing/phing": "^3.0.0-RC4",
1416
"phpunit/phpunit": "^9.5.0"
1517
},
1618
"autoload": {
@@ -25,6 +27,9 @@
2527
},
2628
"config": {
2729
"bin-dir": "bin/",
28-
"sort-packages": true
30+
"sort-packages": true,
31+
"allow-plugins": {
32+
"phing/phing-composer-configurator": true
33+
}
2934
}
3035
}

0 commit comments

Comments
 (0)