Skip to content
This repository was archived by the owner on Dec 11, 2020. It is now read-only.

Enhancement: Switch to using GitHub actions #1847

Merged
merged 6 commits into from
Dec 2, 2019
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
114 changes: 110 additions & 4 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,117 @@ on:
name: "Continuous Integration"

jobs:
hello:
name: "Hello"
coding-standards:
name: "Coding Standards"

runs-on: ubuntu-latest

strategy:
matrix:
php-version:
- 7.2

steps:
- name: "Checkout"
uses: actions/checkout@v1

- name: "Install PHP with extensions"
uses: shivammathur/setup-php@v1
with:
coverage: none
extension-csv: "intl"
php-version: ${{ matrix.php-version }}

- name: "Cache dependencies installed with composer"
uses: actions/cache@v1
with:
path: ~/.composer/cache
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php-version }}-composer-

- name: "Install dependencies with composer"
run: $(which composer) install --no-interaction --no-progress --no-suggest

- name: "Run squizlabs/php_codesniffer"
run: vendor/bin/phpcs --standard=PSR2 src -n

tests:
name: "Tests"

runs-on: ubuntu-latest

strategy:
matrix:
php-version:
- 7.2
- 7.3
- 7.4

steps:
- name: "Hello"
run: echo "Hello, François and Pim!"
- name: "Checkout"
uses: actions/checkout@v1

- name: "Install PHP with extensions"
uses: shivammathur/setup-php@v1
with:
coverage: none
extension-csv: "intl"
php-version: ${{ matrix.php-version }}

- name: "Cache dependencies installed with composer"
uses: actions/cache@v1
with:
path: ~/.composer/cache
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php-version }}-composer-

- name: "Install dependencies with composer"
run: $(which composer) install --no-interaction --no-progress --no-suggest

- name: "Run tests with phpunit/phpunit"
run: vendor/bin/phpunit

code-coverage:
name: "Code Coverage"

runs-on: ubuntu-latest

strategy:
matrix:
php-version:
- 7.4

steps:
- name: "Checkout"
uses: actions/checkout@v1

- name: "Install PHP with extensions"
uses: shivammathur/setup-php@v1
with:
coverage: xdebug
extension-csv: "intl"
php-version: ${{ matrix.php-version }}

- name: "Cache dependencies installed with composer"
uses: actions/cache@v1
with:
path: ~/.composer/cache
key: php${{ matrix.php-version }}-composer-locked-${{ hashFiles('**/composer.json') }}
restore-keys: |
php${{ matrix.php-version }}-composer-locked-

- name: "Install locked dependencies with composer"
run: $(which composer) install --no-interaction --no-progress --no-suggest

- name: "Create build directory"
run: mkdir -p .build/logs

- name: "Collect code coverage with Xdebug and phpunit/phpunit"
run: vendor/bin/phpunit --coverage-clover=.build/logs/clover.xml

- name: "Send code coverage report to Codecov.io"
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run: bash <(curl -s https://codecov.io/bash)
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@
<directory>./test/Faker/</directory>
</testsuite>
</testsuites>

<filter>
<whitelist addUncoveredFilesFromWhitelist="true" processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
</phpunit>
5 changes: 4 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Faker

[![Continuous Integration](https://github.com/fzaninotto/Faker/workflows/Continuous%20Integration/badge.svg)](https://github.com/fzaninotto/Faker/actions)
[![codecov](https://codecov.io/gh/fzaninotto/Faker/branch/next/graph/badge.svg)](https://codecov.io/gh/fzaninotto/Faker)

Faker is a PHP library that generates fake data for you. Whether you need to bootstrap your database, create good-looking XML documents, fill-in your persistence to stress test it, or anonymize data taken from a production service, Faker is for you.

Faker is heavily inspired by Perl's [Data::Faker](http://search.cpan.org/~jasonk/Data-Faker-0.07/), and by ruby's [Faker](https://rubygems.org/gems/faker).
Expand Down Expand Up @@ -53,7 +56,7 @@ composer require fzaninotto/faker

### Autoloading

Faker supports both `PSR-0` as `PSR-4` autoloaders.
Faker supports both `PSR-0` as `PSR-4` autoloaders.
```php
<?php
# When installed via composer
Expand Down