Skip to content

Commit 3b863e4

Browse files
authored
Move ci to Github Actions in favour of Travis (#38)
Move CI to Github Actions in favour of Travis CI
1 parent ac710bf commit 3b863e4

File tree

3 files changed

+50
-43
lines changed

3 files changed

+50
-43
lines changed

.coveralls.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
service_name: travis-ci
1+
service_name: github-actions
22
coverage_clover: build/logs/clover.xml
33
json_path: build/logs/coveralls-upload.json

.github/workflows/main.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
tests:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
php: ['7.2', '7.3', '7.4', '8.0']
11+
12+
name: PHP ${{ matrix.php }} tests
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
17+
- name: Setup PHP
18+
uses: shivammathur/setup-php@v2
19+
with:
20+
php-version: ${{ matrix.php }}
21+
extensions: mbstring, json
22+
coverage: xdebug
23+
24+
- name: Install dependencies
25+
run: composer install
26+
27+
- name: Prepare codeclimate test reporter
28+
if: ${{ matrix.php == '8.0' }}
29+
run: |
30+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
31+
chmod +x ./cc-test-reporter
32+
./cc-test-reporter before-build
33+
34+
- name: Execute tests
35+
run: XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-clover=build/logs/clover.xml --testdox
36+
37+
- name: Upload the reports to coveralls.io
38+
if: ${{ matrix.php == '8.0' }}
39+
run: |
40+
composer global require php-coveralls/php-coveralls
41+
php-coveralls -v
42+
env:
43+
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
45+
- name: Upload the reports to codeclimate
46+
if: ${{ matrix.php == '8.0' }}
47+
run: sudo ./cc-test-reporter after-build -r $CC_TEST_REPORTER_ID
48+
env:
49+
CC_TEST_REPORTER_ID: 5e32818628fac9eb11d34e2b35289f88169610cc4a98c6f170c74923342284f1

.travis.yml

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

0 commit comments

Comments
 (0)