Skip to content

Commit d24f266

Browse files
Merge pull request #35 from martin-helmich/task/migrate-actions
Migrate to Github Actions
2 parents a0a7f37 + a23f374 commit d24f266

File tree

4 files changed

+62
-28
lines changed

4 files changed

+62
-28
lines changed

.github/workflows/php.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Unit tests
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
strategy:
8+
matrix:
9+
php: ['7.2', '7.3', '7.4']
10+
phpunit: ['6.0', '7.0', '8.0']
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v1
15+
16+
- name: Setup PHP
17+
uses: shivammathur/setup-php@v1
18+
with:
19+
php-version: ${{ matrix.php }}
20+
extensions: mbstring, intl, json, mongodb
21+
coverage: pcov
22+
23+
- name: Validate composer.json and composer.lock
24+
run: composer validate
25+
26+
- name: Declare required PHPUnit version
27+
run: |
28+
composer require --no-update --dev phpunit/phpunit ~${{ matrix.phpunit }}
29+
30+
- name: Install dependencies
31+
run: composer install --prefer-dist --no-progress --no-suggest
32+
33+
#- name: Run type checker
34+
# run: ./vendor/bin/psalm
35+
36+
- name: Run unit tests
37+
run: ./vendor/bin/phpunit --testdox
38+
39+
coverage:
40+
runs-on: ubuntu-latest
41+
42+
steps:
43+
- uses: actions/checkout@v1
44+
45+
- name: Setup PHP
46+
uses: shivammathur/setup-php@v1
47+
with:
48+
php-version: 7.4
49+
extensions: mbstring, intl, json, mongodb
50+
coverage: pcov
51+
52+
- name: Install dependencies
53+
run: composer install --prefer-dist --no-progress --no-suggest
54+
55+
- name: Test & publish code coverage
56+
uses: paambaati/codeclimate-action@v2.3.0
57+
env:
58+
CC_TEST_REPORTER_ID: ${{ secrets.codeClimateReporterID }}
59+
with:
60+
coverageCommand: ./vendor/bin/phpunit --coverage-clover=clover.xml
61+
debug: true

.travis.yml

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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MongoDB mock classes
22

3-
[![Build Status](https://travis-ci.org/martin-helmich/php-mongomock.svg?branch=master)](http://travis-ci.org/martin-helmich/php-mongomock)
3+
![Unit tests](https://github.com/martin-helmich/php-mongomock/workflows/Unit%20tests/badge.svg)
44

55
## Author and license
66

phpunit.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88
<directory>tests</directory>
99
</testsuite>
1010
</testsuites>
11-
<logging>
12-
<log type="coverage-html" target="build/coverage" lowUpperBound="35"
13-
highLowerBound="70"/>
14-
<log type="junit" target="build/phpunit"/>
15-
</logging>
1611
<filter>
1712
<whitelist processUncoveredFilesFromWhitelist="true">
1813
<directory suffix=".php">src</directory>

0 commit comments

Comments
 (0)