Skip to content

Commit

Permalink
Merge 7178be2 into d7cb0c3
Browse files Browse the repository at this point in the history
  • Loading branch information
mpyw committed Jul 1, 2021
2 parents d7cb0c3 + 7178be2 commit 088d41c
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 36 deletions.
2 changes: 2 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage_clover: build/logs/clover.xml
json_path: build/logs/coveralls-upload.json
30 changes: 28 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ jobs:
strategy:
matrix:
php: [7.2, 7.3, 7.4, 8.0]
composer_flags: [--prefer-stable --prefer-lowest, --prefer-stable]

steps:
- uses: actions/checkout@v2
Expand All @@ -19,5 +20,30 @@ jobs:
php-version: ${{ matrix.php }}
coverage: xdebug

- run: composer update
- run: vendor/bin/phpunit
- run: composer require phpunit/phpunit --dev --prefer-stable
- run: composer update ${{ matrix.composer_flags }}
- run: mkdir -p build/logs
- run: vendor/bin/phpunit --coverage-clover build/logs/clover.xml

- name: Upload Coverage
uses: nick-invision/retry@v2
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: 'true'
COVERALLS_FLAG_NAME: 'php:${{ matrix.php }}'
with:
timeout_minutes: 1
max_attempts: 3
command: |
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=build/logs/clover.xml -v
coverage-aggregation:
needs: build
runs-on: ubuntu-latest
steps:
- name: Aggregate Coverage
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
35 changes: 25 additions & 10 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
checks:
php:
code_rating: true

filter:
excluded_paths:
- tests/*
- vendor/*

build:

nodes:
analysis:
tests:
override:
- php-scrutinizer-run

environment:
php:
version: 7.4
php: '7.4'

dependencies:
before:
- composer install
- mkdir -p build/logs

tests:
override:
-
command: 'vendor/bin/phpunit --coverage-clover coverage-report'
command: 'vendor/bin/phpunit --coverage-clover build/logs/clover.xml'
coverage:
file: 'coverage-report'
file: 'build/logs/clover.xml'
format: 'clover'

tools:
php_code_sniffer:
enabled: true
config:
standard: PSR2
30 changes: 6 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# mpyw/opengraph

[![Build Status](https://github.com/mpyw/opengraph/actions/workflows/ci.yml/badge.svg)](https://github.com/mpyw/opengraph/actions)
[![](https://scrutinizer-ci.com/g/mpyw/opengraph/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/mpyw/opengraph/?branch=master)
[![Build Status](https://github.com/mpyw/opengraph/actions/workflows/ci.yml/badge.svg)](https://github.com/mpyw/opengraph/actions) [![Coverage Status](https://coveralls.io/repos/github/mpyw/opengraph/badge.svg?branch=master)](https://coveralls.io/github/mpyw/opengraph?branch=master) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/mpyw/opengraph/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/mpyw/opengraph/?branch=master)

A simple library to read Open Graph data from the web and generate HTML code to publish your own Open Graph objects. A fallback mode enables you to read data from websites that do not implement the Open Graph protocol.

Expand All @@ -11,31 +10,14 @@ See [ogp.me](http://ogp.me) for information on the Open Graph protocol.

## Requirements

* PHP `^7.2 || ^8.0`
* [symfony/css-selector](https://github.com/symfony/CssSelector)
* [symfony/dom-crawler](https://github.com/symfony/DomCrawler)
- PHP `^7.2 || ^8.0`
- [symfony/css-selector](https://github.com/symfony/CssSelector): `^4.1`
- [symfony/dom-crawler](https://github.com/symfony/DomCrawler): `^4.1`

## Installation
## Installing

The most flexible installation method is using Composer: Simply create a composer.json file in the root of your project:
```json
{
"require": {
"mpyw/opengraph": "^0.1"
}
}
```

Install composer and run install command:
```bash
curl -s http://getcomposer.org/installer | php
php composer.phar install
```

Once installed, include vendor/autoload.php in your script.

```php
require 'vendor/autoload.php';
composer require mpyw/opengraph
```

## Usage
Expand Down

0 comments on commit 088d41c

Please sign in to comment.