Skip to content

Commit

Permalink
Enhancement: Run builds on master using GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Mar 11, 2020
1 parent 3201746 commit d8104c1
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 66 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/test/ export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/CONTRIBUTING.md export-ignore
/Makefile export-ignore
/phpunit.xml.dist export-ignore
144 changes: 144 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

on:
pull_request:
push:
branches:
- "master"
tags:
- "**"

name: "Continuous Integration"

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

runs-on: "ubuntu-latest"

strategy:
matrix:
php-version:
- "5.3"

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

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

- name: "Determine composer cache directory"
id: "determine-composer-cache-directory"
run: "echo \"::set-output name=directory::$(composer config cache-dir)\""

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

- name: "Install dependencies with composer"
run: "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:
- "5.3"
- "5.4"
- "5.5"
- "5.6"
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4"

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

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
extensions: "intl"
ini-values: "memory_limit=-1"
php-version: "${{ matrix.php-version }}"

- name: "Determine composer cache directory"
id: "determine-composer-cache-directory"
run: "echo \"::set-output name=directory::$(composer config cache-dir)\""

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

- name: "Install dependencies with composer"
run: "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@v2"

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
coverage: "xdebug"
extensions: "intl"
ini-values: "memory_limit=-1"
php-version: "${{ matrix.php-version }}"

- name: "Determine composer cache directory"
id: "determine-composer-cache-directory"
run: "echo \"::set-output name=directory::$(composer config cache-dir)\""

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

- name: "Install dependencies with composer"
run: "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 }}"
run: "bash <(curl -s https://codecov.io/bash)"
41 changes: 0 additions & 41 deletions .travis.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .travis/xdebug.sh

This file was deleted.

4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Faker

[![Monthly Downloads](https://poser.pugx.org/fzaninotto/faker/d/monthly.png)](https://packagist.org/packages/fzaninotto/faker)
[![Build Status](https://travis-ci.org/fzaninotto/Faker.svg?branch=master)](https://travis-ci.org/fzaninotto/Faker)
[![Code Coverage](https://codecov.io/gh/fzaninotto/Faker/branch/master/graph/badge.svg)](https://codecov.io/gh/fzaninotto/Faker)
[![Continuous Integration](https://github.com/fzaninotto/Faker/workflows/Continuous%20Integration/badge.svg?branch=master)](https://github.com/fzaninotto/Faker/actions)
[![codecov](https://codecov.io/gh/fzaninotto/Faker/branch/master/graph/badge.svg)](https://codecov.io/gh/fzaninotto/Faker)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/eceb78a9-38d4-4ad5-8b6b-b52f323e3549/mini.png)](https://insight.sensiolabs.com/projects/eceb78a9-38d4-4ad5-8b6b-b52f323e3549)

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.
Expand Down

0 comments on commit d8104c1

Please sign in to comment.