Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Github Actions CI #48

Merged
merged 1 commit into from
Mar 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.github export-ignore
.php_cs export-ignore
.travis.yml export-ignore
phpunit.xml.dist export-ignore
75 changes: 75 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: "CI"

on:
pull_request:
push:
branches:
- "master"
schedule:
- cron: "42 3 * * *"

jobs:
phpunit:
name: "PHPUnit"
runs-on: "ubuntu-20.04"

strategy:
matrix:
php-version:
- "7.3"
- "7.4"
- "8.0"
dependencies:
- "highest"
include:
- dependencies: "lowest"
php-version: "7.3"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 2

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php-version }}"
coverage: "pcov"
ini-values: "zend.assertions=1"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Run PHPUnit"
run: "vendor/bin/phpunit --coverage-clover=coverage.xml"

- name: "Upload coverage file"
uses: "actions/upload-artifact@v2"
with:
name: "phpunit-${{ matrix.deps }}-${{ matrix.php-version }}.coverage"
path: "coverage.xml"

upload_coverage:
name: "Upload coverage to Codecov"
runs-on: "ubuntu-20.04"
needs:
- "phpunit"

steps:
- name: "Checkout"
uses: "actions/checkout@v2"
with:
fetch-depth: 2

- name: "Download coverage files"
uses: "actions/download-artifact@v2"
with:
path: "reports"

- name: "Upload to Codecov"
uses: "codecov/codecov-action@v1"
with:
directory: reports
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ DataLoaderPHP is a generic utility to be used as part of your application's data
fetching layer to provide a simplified and consistent API over various remote
data sources such as databases or web services via batching and caching.

[![Build Status](https://travis-ci.org/overblog/dataloader-php.svg?branch=master)](https://travis-ci.org/overblog/dataloader-php)
[![Coverage Status](https://coveralls.io/repos/github/overblog/dataloader-php/badge.svg?branch=master)](https://coveralls.io/github/overblog/dataloader-php?branch=master)
[![GitHub Actions][GA master image]][GA master]
[![Code Coverage][Coverage image]][CodeCov Master]
[![Latest Stable Version](https://poser.pugx.org/overblog/dataloader-php/version)](https://packagist.org/packages/overblog/dataloader-php)
[![License](https://poser.pugx.org/overblog/dataloader-php/license)](https://packagist.org/packages/overblog/dataloader-php)

Expand Down Expand Up @@ -402,3 +402,8 @@ Also, large parts of the documentation have been ported from the dataLoader Node
## License

Overblog/DataLoaderPHP is released under the [MIT](https://github.com/overblog/dataloader-php/blob/master/LICENSE) license.

[Coverage image]: https://codecov.io/gh/overblog/dataloader-php/branch/master/graph/badge.svg
[CodeCov Master]: https://codecov.io/gh/overblog/dataloader-php/branch/master
[GA master]: https://github.com/overblog/dataloader-php/actions?query=workflow%3A%22CI%22+branch%3Amaster
[GA master image]: https://github.com/overblog/dataloader-php/workflows/CI/badge.svg