-
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (59 loc) · 2.1 KB
/
Copy pathcoverage.yml
File metadata and controls
71 lines (59 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Coverage
on:
push:
branches: [ '**' ]
pull_request:
branches: [ '**' ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['8.2']
setup: ['stable']
name: PHP
steps:
- uses: actions/checkout@v6
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: xdebug
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v4
with:
path: vendor
key: coverage-${{ runner.os }}-${{ matrix.setup }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
coverage-${{ runner.os }}-${{ matrix.setup }}-php-${{ matrix.php }}-
- name: Code Climate Test Reporter Preparation
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
./cc-test-reporter before-build
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
- name: Install dependencies
if: steps.composer-cache.outputs.cache-hit != 'true'
run: |
composer config version 1.9.0
composer update --prefer-dist ${{ matrix.setup != 'next' && format('--prefer-{0}', matrix.setup) || '' }} --no-progress ${{ matrix.php >= 8.1 && '--ignore-platform-req=php' || '' }}
- name: Prepare git config
run: |
git config --global init.defaultBranch main
git config --global user.name tester
git config --global user.email tester@phug-lang.com
- name: Run test suite
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml
- name: Code Climate Test Reporter
if: ${{ env.CC_TEST_REPORTER_ID != '' }}
run: |
cp coverage.xml clover.xml
bash <(curl -s https://codecov.io/bash)
./cc-test-reporter after-build --coverage-input-type clover --exit-code 0
composer config version 1.9.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}