Skip to content

Commit 305a9dc

Browse files
committed
adds codecov.
1 parent bf2fa4e commit 305a9dc

File tree

3 files changed

+21
-20
lines changed

3 files changed

+21
-20
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,28 @@ on: [push]
55
jobs:
66
build-test:
77
runs-on: ubuntu-latest
8-
container:
9-
image: php:8.4 # This forces the job to run in a Docker container
108

119
steps:
1210
- name: Checkout
1311
uses: actions/checkout@v3
1412

15-
- name: Install System Dependencies (Git, Zip, Unzip)
16-
run: |
17-
apt-get update
18-
apt-get install -y unzip git zip
19-
20-
- name: Install and Enable extensions
21-
run: |
22-
docker-php-ext-install sockets calendar
23-
docker-php-ext-enable sockets calendar
24-
25-
- name: Install Composer
26-
run: |
27-
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
28-
composer --version
13+
- name: Setup PHP
14+
uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: 8.4
17+
extensions: sockets, calendar, pcov
18+
coverage: pcov
2919

3020
- name: Install Dependencies
31-
run: composer install --prefer-dist --no-progress
32-
33-
- name: Run PHPUnit
34-
run: vendor/bin/phpunit tests
21+
run: composer install --prefer-dist --no-progress --no-interaction --optimize-autoloader
22+
23+
- name: Run PHPUnit with Coverage
24+
run: vendor/bin/phpunit tests --coverage-clover coverage.xml --coverage-filter src
25+
26+
- name: Upload coverage to Codecov
27+
uses: codecov/codecov-action@v3
28+
with:
29+
files: ./coverage.xml
30+
flags: formatters
31+
token: ${{ secrets.CODECOV_TOKEN }}
32+
fail_ci_if_error: false

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ node_modules
77
.DS_STORE
88
public_html/
99
.phpunit.result.cache
10+
11+
coverage.xml

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[![CI](https://github.com/Neuron-PHP/formatting/actions/workflows/ci.yml/badge.svg)](https://github.com/Neuron-PHP/formatting/actions)
2+
[![codecov](https://codecov.io/gh/Neuron-PHP/formatting/graph/badge.svg)](https://codecov.io/gh/Neuron-PHP/formatting)
23

34
# Neuron-PHP Formatting
45

0 commit comments

Comments
 (0)