Skip to content

Commit b2f1150

Browse files
Copilotdasco144coderabbitai[bot]echarrod
authored
Add CI checks with GitHub Actions (#45)
* Initial plan * Add CI checks with GitHub Actions Co-authored-by: dasco144 <10575019+dasco144@users.noreply.github.com> * Update actions/cache version used Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Remove master branch Co-authored-by: Ed Harrod <echarrod@users.noreply.github.com> * Narrow supported versions Co-authored-by: Ed Harrod <echarrod@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: dasco144 <10575019+dasco144@users.noreply.github.com> Co-authored-by: Daniel Santiago <dasco144@hotmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Ed Harrod <echarrod@users.noreply.github.com>
1 parent c21693f commit b2f1150

File tree

4 files changed

+52
-10
lines changed

4 files changed

+52
-10
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
name: Test PHP ${{ matrix.php-version }}
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
php-version: ['8.2', '8.3', '8.4']
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: ${{ matrix.php-version }}
26+
coverage: none
27+
28+
- name: Validate composer.json and composer.lock
29+
run: composer validate --strict
30+
31+
- name: Cache Composer packages
32+
id: composer-cache
33+
uses: actions/cache@v4
34+
with:
35+
path: vendor
36+
key: ${{ runner.os }}-php-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
37+
restore-keys: |
38+
${{ runner.os }}-php-${{ matrix.php-version }}-
39+
40+
- name: Install dependencies
41+
run: composer install --prefer-dist --no-progress
42+
43+
- name: Run test suite
44+
run: vendor/bin/phpunit

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ composer.lock
22
composer.phar
33
vendor/
44
.idea/
5+
.phpunit.result.cache

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"name": "luno/luno-php",
3-
"version": "0.0.14",
43
"type": "library",
54
"description": "PHP SDK for the Luno API",
65
"keywords": ["luno", "bitcoin", "ethereum"],
@@ -22,6 +21,6 @@
2221
"netresearch/jsonmapper": "^1.4"
2322
},
2423
"require-dev": {
25-
"phpunit/phpunit": "7.1.4"
24+
"phpunit/phpunit": "^9.0"
2625
}
2726
}

phpunit.xml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
<?xml version="1.0"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/7.1/phpunit.xsd"
4-
bootstrap="vendor/autoload.php">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="vendor/autoload.php">
3+
<coverage processUncoveredFiles="true">
4+
<include>
5+
<directory suffix=".php">src/Luno/</directory>
6+
</include>
7+
</coverage>
58
<testsuites>
69
<testsuite name="luno">
710
<directory suffix=".php">test/</directory>
811
</testsuite>
912
</testsuites>
10-
<filter>
11-
<whitelist processUncoveredFilesFromWhitelist="true">
12-
<directory suffix=".php">src/Luno/</directory>
13-
</whitelist>
14-
</filter>
1513
</phpunit>

0 commit comments

Comments
 (0)