Skip to content

Commit

Permalink
Fix codecov commands (#23)
Browse files Browse the repository at this point in the history
* fix commands

* update readme

Signed-off-by: Nikolay Gagarinov <[email protected]>

* update readme

* update PHP version

* update codeclimate aciton

* trigger ci

* try fix codecov

* comment test-coverage

---------

Signed-off-by: Nikolay Gagarinov <[email protected]>
  • Loading branch information
fey authored Oct 26, 2023
1 parent aee8286 commit 938d993
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 23 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,22 @@ jobs:
uses: shivammathur/setup-php@v2
with:
# Specify the PHP version
php-version: '8.1'
php-version: '8.2'
- name: Install
# Install project
run: make install
- name: Run linter
# Run Linter
run: make lint
# Publish code coverage on Code Climate
# https://github.com/paambaati/codeclimate-action
- name: Run test & publish code coverage
uses: paambaati/[email protected]
# Add Code Climate secret key
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: make test-coverage
coverageLocations: ${{github.workplace}}/build/logs/clover.xml:clover
debug: true
# Publish code coverage on Code Climate
# https://github.com/paambaati/codeclimate-action
# NOTE: uncomment for using workflow
# - name: Run test & publish code coverage
# uses: paambaati/codeclimate-action@v5
# # Add Code Climate secret key
# env:
# CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
# with:
# coverageCommand: make test-coverage
# coverageLocations: build/logs/clover.xml:clover
# debug: true
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ test:
composer exec --verbose phpunit tests

test-coverage:
composer exec --verbose phpunit tests -- --coverage-clover build/logs/clover.xml
XDEBUG_MODE=coverage composer exec --verbose phpunit tests -- --coverage-clover build/logs/clover.xml

test-coverage-text:
XDEBUG_MODE=coverage composer exec --verbose phpunit tests -- --coverage-text
27 changes: 17 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,41 @@
[![Issue Count](https://codeclimate.com/github/hexlet-boilerplates/php-package/badges/issue_count.svg)](https://codeclimate.com/github/hexlet-boilerplates/php-package/issues)
[![Test Coverage](https://codeclimate.com/github/hexlet-boilerplates/php-package/badges/coverage.svg)](https://codeclimate.com/github/hexlet-boilerplates/php-package/coverage)

## Prerequisites

* Linux, Macos, WSL
* PHP >=8.2
* Xdebug
* Make
* Git

## Addons

Use <http://psysh.org/>

## Setup

```sh
$ git clone https://github.com/hexlet-boilerplates/php-package.git

$ cd php-package

$ make install
```bash
git clone https://github.com/hexlet-boilerplates/php-package.gi
cd php-package
make install
```

## Run tests

```sh
$ make test
make test
```

## Test Coverage

- see `phpunit.xml`
- <https://docs.codeclimate.com/docs/configuring-test-coverage>
- add CC_TEST_REPORTER_ID to workflow as SECERETS ENV VARIABLE (for safety)
* see `phpunit.xml`
* See [codeclimate documentation](https://docs.codeclimate.com/docs/configuring-test-coverage)
* add `CC_TEST_REPORTER_ID` to workflow as SECRETS ENV VARIABLE (for safety)

[![Hexlet Ltd. logo](https://raw.githubusercontent.com/Hexlet/assets/master/images/hexlet_logo128.png)](https://hexlet.io/?utm_source=github&utm_medium=link&utm_campaign=php-package)

This repository is created and maintained by the team and the community of Hexlet, an educational project. [Read more about Hexlet](https://hexlet.io/?utm_source=github&utm_medium=link&utm_campaign=php-package).


See most active contributors on [hexlet-friends](https://friends.hexlet.io/).

0 comments on commit 938d993

Please sign in to comment.