Skip to content

Commit e464dc9

Browse files
authored
Merge pull request #301 from Art4/replace-travis-with-github-actions
Replace Travis-ci with GitHub Actions
2 parents 4daf0db + e6b98d5 commit e464dc9

File tree

7 files changed

+111
-63
lines changed

7 files changed

+111
-63
lines changed

.github/workflows/tests.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
9+
tests:
10+
name: Tests (PHP ${{ matrix.php-versions }} on ${{ matrix.operating-system }})
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
operating-system: ['ubuntu-latest']
17+
php-versions: ['7.4', '8.0', '8.1']
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
with:
23+
fetch-depth: 2
24+
25+
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
26+
27+
- name: Setup PHP, with composer and extensions
28+
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
29+
with:
30+
php-version: ${{ matrix.php-versions }}
31+
tools: phpunit
32+
extensions: mbstring, xml, ctype, iconv, intl, pdo_sqlite
33+
coverage: xdebug
34+
35+
- name: Get composer cache directory
36+
id: composer-cache
37+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
38+
39+
- name: Cache composer dependencies
40+
uses: actions/cache@v2
41+
with:
42+
path: ${{ steps.composer-cache.outputs.dir }}
43+
# Use composer.json for key, if composer.lock is not committed.
44+
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
45+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
46+
restore-keys: ${{ runner.os }}-composer-
47+
48+
- name: Install Composer dependencies
49+
run: composer install --no-progress --prefer-dist --optimize-autoloader
50+
51+
- name: Run tests
52+
run: vendor/bin/phpunit --coverage-text
53+
54+
- run: echo "🍏 This job's status is ${{ job.status }}."

.travis.yml

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

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased](https://github.com/kbsali/php-redmine-api/compare/v2.0.1...v2.x)
99

10+
### Changed
11+
12+
- Switched from Travis-CI to Github Actions
13+
1014
### Deprecated
1115

1216
- `Redmine\Api\AbstractApi::lastCallFailed()` is deprecated, use `Redmine\Client\Client::getLastResponseStatusCode()` instead

README.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# PHP Redmine API
22

3+
[![Latest Version](https://img.shields.io/github/release/kbsali/php-redmine-api.svg)](https://github.com/kbsali/php-redmine-api/releases)
4+
[![Software License](https://img.shields.io/badge/license-MIT-blueviolet.svg)](LICENSE)
5+
[![Build Status](https://github.com/kbsali/php-redmine-api/actions/workflows/tests.yml/badge.svg?branch=v2.x)](https://github.com/kbsali/php-redmine-api/actions)
6+
[![Total Downloads](https://img.shields.io/packagist/dt/kbsali/redmine-api.svg)](https://packagist.org/packages/kbsali/redmine-api)
7+
38
A simple PHP Object Oriented wrapper for Redmine API.
49

510
Uses [Redmine API](http://www.redmine.org/projects/redmine/wiki/Rest_api/).
@@ -11,25 +16,25 @@ Uses [Redmine API](http://www.redmine.org/projects/redmine/wiki/Rest_api/).
1116
[PSR-18](https://www.php-fig.org/psr/psr-18/) http client like
1217
[Guzzle](https://github.com/guzzle/guzzle) for handling http connections
1318
* API entry points implementation state:
14-
* OK Attachments
15-
* OK Groups
16-
* OK Custom Fields
17-
* OK Issues
18-
* OK Issue Categories
19-
* OK Issue Priorities
20-
* *NOK Issue Relations - only partially implemented*
21-
* OK Issue Statuses
22-
* OK News
23-
* OK Projects
24-
* OK Project Memberships
25-
* OK Queries
26-
* OK Roles
27-
* OK Time Entries
28-
* OK Time Entry Activities
29-
* OK Trackers
30-
* OK Users
31-
* OK Versions
32-
* OK Wiki
19+
* :heavy_check_mark: Attachments
20+
* :heavy_check_mark: Groups
21+
* :heavy_check_mark: Custom Fields
22+
* :heavy_check_mark: Issues
23+
* :heavy_check_mark: Issue Categories
24+
* :heavy_check_mark: Issue Priorities
25+
* :x: *Issue Relations - only partially implemented*
26+
* :heavy_check_mark: Issue Statuses
27+
* :heavy_check_mark: News
28+
* :heavy_check_mark: Projects
29+
* :heavy_check_mark: Project Memberships
30+
* :heavy_check_mark: Queries
31+
* :heavy_check_mark: Roles
32+
* :heavy_check_mark: Time Entries
33+
* :heavy_check_mark: Time Entry Activities
34+
* :heavy_check_mark: Trackers
35+
* :heavy_check_mark: Users
36+
* :heavy_check_mark: Versions
37+
* :heavy_check_mark: Wiki
3338

3439
## Todo
3540

tests/Integration/Psr18ClientRequestGenerationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
class Psr18ClientRequestGenerationTest extends TestCase
1818
{
1919
/**
20-
* @covers \Redmine\Psr18Client
20+
* @covers \Redmine\Client\Psr18Client
2121
* @test
2222
*
2323
* @dataProvider createdGetRequestsData

tests/Unit/Client/NativeCurlClientTest.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class NativeCurlClientTest extends TestCase
3232
];
3333

3434
/**
35-
* @covers \Redmine\NativeCurlClient
35+
* @covers \Redmine\Client\NativeCurlClient
3636
* @test
3737
*/
3838
public function shouldPassApiKeyToConstructor()
@@ -47,7 +47,7 @@ public function shouldPassApiKeyToConstructor()
4747
}
4848

4949
/**
50-
* @covers \Redmine\NativeCurlClient
50+
* @covers \Redmine\Client\NativeCurlClient
5151
* @test
5252
*/
5353
public function shouldPassUsernameAndPasswordToConstructor()
@@ -63,7 +63,7 @@ public function shouldPassUsernameAndPasswordToConstructor()
6363
}
6464

6565
/**
66-
* @covers \Redmine\NativeCurlClient
66+
* @covers \Redmine\Client\NativeCurlClient
6767
* @test
6868
*/
6969
public function testGetLastResponseStatusCodeIsInitialNull()
@@ -77,7 +77,7 @@ public function testGetLastResponseStatusCodeIsInitialNull()
7777
}
7878

7979
/**
80-
* @covers \Redmine\NativeCurlClient
80+
* @covers \Redmine\Client\NativeCurlClient
8181
* @test
8282
*/
8383
public function testGetLastResponseContentTypeIsInitialEmpty()
@@ -91,7 +91,7 @@ public function testGetLastResponseContentTypeIsInitialEmpty()
9191
}
9292

9393
/**
94-
* @covers \Redmine\NativeCurlClient
94+
* @covers \Redmine\Client\NativeCurlClient
9595
* @test
9696
*/
9797
public function testGetLastResponseBodyIsInitialEmpty()
@@ -105,7 +105,7 @@ public function testGetLastResponseBodyIsInitialEmpty()
105105
}
106106

107107
/**
108-
* @covers \Redmine\NativeCurlClient
108+
* @covers \Redmine\Client\NativeCurlClient
109109
* @test
110110
*/
111111
public function testStartAndStopImpersonateUser()
@@ -174,7 +174,7 @@ public function testStartAndStopImpersonateUser()
174174
}
175175

176176
/**
177-
* @covers \Redmine\NativeCurlClient
177+
* @covers \Redmine\Client\NativeCurlClient
178178
* @test
179179
*/
180180
public function testSetSslVersion()
@@ -242,7 +242,7 @@ public function testSetSslVersion()
242242
}
243243

244244
/**
245-
* @covers \Redmine\NativeCurlClient
245+
* @covers \Redmine\Client\NativeCurlClient
246246
* @test
247247
*/
248248
public function testSetSslVerifypeer()
@@ -311,7 +311,7 @@ public function testSetSslVerifypeer()
311311
}
312312

313313
/**
314-
* @covers \Redmine\NativeCurlClient
314+
* @covers \Redmine\Client\NativeCurlClient
315315
* @test
316316
*/
317317
public function testSetSslVerifyhost()
@@ -380,7 +380,7 @@ public function testSetSslVerifyhost()
380380
}
381381

382382
/**
383-
* @covers \Redmine\NativeCurlClient
383+
* @covers \Redmine\Client\NativeCurlClient
384384
* @test
385385
*/
386386
public function testSetCustomHttpHeaders()
@@ -455,7 +455,7 @@ public function testSetCustomHttpHeaders()
455455
}
456456

457457
/**
458-
* @covers \Redmine\NativeCurlClient
458+
* @covers \Redmine\Client\NativeCurlClient
459459
* @test
460460
*/
461461
public function testSetCustomHost()
@@ -526,7 +526,7 @@ public function testSetCustomHost()
526526
}
527527

528528
/**
529-
* @covers \Redmine\NativeCurlClient
529+
* @covers \Redmine\Client\NativeCurlClient
530530
* @test
531531
*/
532532
public function testSetPort()
@@ -594,7 +594,7 @@ public function testSetPort()
594594
}
595595

596596
/**
597-
* @covers \Redmine\NativeCurlClient
597+
* @covers \Redmine\Client\NativeCurlClient
598598
* @test
599599
*/
600600
public function testCustomPortWillSetFromSchema()
@@ -650,7 +650,7 @@ public function testCustomPortWillSetFromSchema()
650650
}
651651

652652
/**
653-
* @covers \Redmine\NativeCurlClient
653+
* @covers \Redmine\Client\NativeCurlClient
654654
* @test
655655
*/
656656
public function testCustomPortWillSetFromUrl()
@@ -706,7 +706,7 @@ public function testCustomPortWillSetFromUrl()
706706
}
707707

708708
/**
709-
* @covers \Redmine\NativeCurlClient
709+
* @covers \Redmine\Client\NativeCurlClient
710710
* @test
711711
* @dataProvider getRequestReponseData
712712
*/
@@ -813,7 +813,7 @@ public function testHandlingOfResponseWithoutContent()
813813
}
814814

815815
/**
816-
* @covers \Redmine\NativeCurlClient
816+
* @covers \Redmine\Client\NativeCurlClient
817817
* @test
818818
*/
819819
public function testCurlErrorThrowsException()
@@ -848,7 +848,7 @@ public function testCurlErrorThrowsException()
848848
}
849849

850850
/**
851-
* @covers \Redmine\NativeCurlClient
851+
* @covers \Redmine\Client\NativeCurlClient
852852
* @test
853853
*
854854
* @param string $apiName
@@ -891,7 +891,7 @@ public function getApiClassesProvider()
891891
}
892892

893893
/**
894-
* @covers \Redmine\NativeCurlClient
894+
* @covers \Redmine\Client\NativeCurlClient
895895
* @test
896896
*/
897897
public function getApiShouldThrowException()

tests/Unit/Client/Psr18ClientTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class Psr18ClientTest extends TestCase
1717
{
1818
/**
19-
* @covers \Redmine\Psr18Client
19+
* @covers \Redmine\Client\Psr18Client
2020
* @test
2121
*/
2222
public function shouldPassApiKeyToConstructor()
@@ -34,7 +34,7 @@ public function shouldPassApiKeyToConstructor()
3434
}
3535

3636
/**
37-
* @covers \Redmine\Psr18Client
37+
* @covers \Redmine\Client\Psr18Client
3838
* @test
3939
*/
4040
public function shouldPassUsernameAndPasswordToConstructor()
@@ -53,7 +53,7 @@ public function shouldPassUsernameAndPasswordToConstructor()
5353
}
5454

5555
/**
56-
* @covers \Redmine\Psr18Client
56+
* @covers \Redmine\Client\Psr18Client
5757
* @test
5858
*/
5959
public function testGetLastResponseStatusCodeIsInitialNull()
@@ -70,7 +70,7 @@ public function testGetLastResponseStatusCodeIsInitialNull()
7070
}
7171

7272
/**
73-
* @covers \Redmine\Psr18Client
73+
* @covers \Redmine\Client\Psr18Client
7474
* @test
7575
*/
7676
public function testGetLastResponseContentTypeIsInitialEmpty()
@@ -87,7 +87,7 @@ public function testGetLastResponseContentTypeIsInitialEmpty()
8787
}
8888

8989
/**
90-
* @covers \Redmine\Psr18Client
90+
* @covers \Redmine\Client\Psr18Client
9191
* @test
9292
*/
9393
public function testGetLastResponseBodyIsInitialEmpty()
@@ -104,7 +104,7 @@ public function testGetLastResponseBodyIsInitialEmpty()
104104
}
105105

106106
/**
107-
* @covers \Redmine\Psr18Client
107+
* @covers \Redmine\Client\Psr18Client
108108
* @test
109109
*/
110110
public function testStartAndStopImpersonateUser()
@@ -139,7 +139,7 @@ public function testStartAndStopImpersonateUser()
139139
}
140140

141141
/**
142-
* @covers \Redmine\Psr18Client
142+
* @covers \Redmine\Client\Psr18Client
143143
* @test
144144
*/
145145
public function testRequestGetReturnsFalse()
@@ -168,7 +168,7 @@ public function testRequestGetReturnsFalse()
168168
}
169169

170170
/**
171-
* @covers \Redmine\Psr18Client
171+
* @covers \Redmine\Client\Psr18Client
172172
* @test
173173
* @dataProvider getRequestReponseData
174174
*/
@@ -233,7 +233,7 @@ public function getRequestReponseData()
233233
}
234234

235235
/**
236-
* @covers \Redmine\Psr18Client
236+
* @covers \Redmine\Client\Psr18Client
237237
* @test
238238
*
239239
* @param string $apiName
@@ -279,7 +279,7 @@ public function getApiClassesProvider()
279279
}
280280

281281
/**
282-
* @covers \Redmine\Psr18Client
282+
* @covers \Redmine\Client\Psr18Client
283283
* @test
284284
*/
285285
public function getApiShouldThrowException()

0 commit comments

Comments
 (0)