forked from leanphp/phpspec-code-coverage
-
Notifications
You must be signed in to change notification settings - Fork 13
49 lines (39 loc) · 1.26 KB
/
test-coverage.yml
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
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
on:
- pull_request
- push
name: "Test Coverage"
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout
uses: actions/checkout@v2.3.1
with:
fetch-depth: 10
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
extensions: pcov
- name: Get Composer Cache Directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache dependencies
uses: actions/cache@v2
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-
- name: "Install dependencies"
uses: "ramsey/composer-install@v2"
- name: Run tests
run: composer run test-coverage
- name: Upload Scrutinizer coverage
uses: sudo-bot/action-scrutinizer@latest
with:
cli-args: "--format=php-clover coverage/clover.xml"