Skip to content

Commit 3cf33b0

Browse files
authored
GitHub actions (part 2) (palicao#25)
Export coverage to codeclimate
1 parent 562f24b commit 3cf33b0

File tree

3 files changed

+17
-21
lines changed

3 files changed

+17
-21
lines changed

.github/workflows/main.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ on:
1313

1414
jobs:
1515
build:
16-
name: PHP ${{ matrix.php-versions }} - RedisTimeSeries ${{ matrix.rts-versions }}
16+
name: PHP ${{ matrix.php-version }} - RedisTimeSeries ${{ matrix.rts-version }}
1717
runs-on: ubuntu-latest
1818
strategy:
1919
matrix:
20-
php-versions: ['7.2', '7.3', '7.4']
21-
rts-versions: ['1.4.8', 'edge']
20+
php-version: ['7.2', '7.3', '7.4']
21+
rts-version: ['1.4.8', 'edge']
2222
services:
2323
redis:
24-
image: redislabs/redistimeseries:${{ matrix.rts-versions }}
24+
image: redislabs/redistimeseries:${{ matrix.rts-version }}
2525
ports:
2626
- 6379:6379
2727
options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3
@@ -31,7 +31,7 @@ jobs:
3131
- name: Setup PHP
3232
uses: shivammathur/setup-php@v2
3333
with:
34-
php-version: ${{ matrix.php-versions }}
34+
php-version: ${{ matrix.php-version }}
3535
extensions: redis
3636
coverage: xdebug
3737
- name: Get composer cache directory
@@ -41,8 +41,6 @@ jobs:
4141
uses: actions/cache@v2
4242
with:
4343
path: ${{ steps.composer-cache.outputs.dir }}
44-
# Use composer.json for key, if composer.lock is not committed.
45-
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
4644
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
4745
restore-keys: ${{ runner.os }}-composer-
4846
- name: Install dependencies
@@ -52,6 +50,13 @@ jobs:
5250
run: vendor/bin/phpunit --coverage-text
5351
env:
5452
REDIS_HOST: localhost
55-
REDIS_TIMESERIES_VERSION: ${{ matrix.rts-versions }}
53+
REDIS_TIMESERIES_VERSION: ${{ matrix.rts-version }}
5654
- name: Run psalm
5755
run: vendor/bin/psalm
56+
- name: Export coverage
57+
uses: paambaati/codeclimate-action@v2.7.5
58+
if: ${{ matrix.php-version == '7.4' && matrix.rts-version == '1.4.8' }}
59+
env:
60+
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}}
61+
with:
62+
coverageLocations: clover.xml:clover

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
/.idea/
22
/vendor/
3-
/build/
4-
.phpunit.result.cache
3+
/clover.xml
4+
/.phpunit.result.cache

phpunit.xml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit
3-
backupGlobals="false"
4-
backupStaticAttributes="false"
53
colors="true"
64
verbose="true"
7-
stopOnError="false"
8-
stopOnFailure="false"
9-
stopOnSkipped="false"
10-
stopOnIncomplete="false"
11-
processIsolation="false"
12-
convertErrorsToExceptions="true"
13-
convertNoticesToExceptions="true"
14-
convertWarningsToExceptions="true"
155
bootstrap="vendor/autoload.php">
166
<testsuites>
177
<testsuite name="General">
@@ -27,6 +17,7 @@
2717
</whitelist>
2818
</filter>
2919
<logging>
30-
<log type="coverage-clover" target="build/logs/clover.xml" />
20+
<log type="coverage-clover" target="clover.xml" />
21+
<log type="coverage-text" target="php://stdout" />
3122
</logging>
3223
</phpunit>

0 commit comments

Comments
 (0)