Skip to content

Commit

Permalink
Switch to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Dec 13, 2020
1 parent 489970b commit 3b63503
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 37 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@
/.gitattributes export-ignore
/.github export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/phpunit.xml.dist export-ignore
/README.md export-ignore
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ Then run [PHPUnit](https://phpunit.de/):
$ vendor/bin/phpunit
```

* The tests will be automatically run by [Travis CI](https://travis-ci.org/) against pull requests.
* The tests will be automatically run by [GitHub Actions](https://github.com/features/actions) against pull requests.
* We also have [StyleCI](https://styleci.io/) setup to automatically fix any code style issues.
16 changes: 16 additions & 0 deletions .github/bin/composer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

EXPECTED_CHECKSUM="$(wget -q -O - https://composer.github.io/installer.sig)"
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")"
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ]; then
>&2 echo 'ERROR: Invalid installer checksum'
rm composer-setup.php
exit 1
else
php composer-setup.php --install-dir="/usr/bin" --filename=composer
RESULT=$?
rm composer-setup.php
composer config platform.php 5.6.50
exit $RESULT
fi
5 changes: 5 additions & 0 deletions .github/bin/hhvm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

echo "deb https://dl.hhvm.com/ubuntu $(lsb_release -sc)-lts-$1 main" >> /etc/apt/sources.list
apt-get update
apt-get --allow-downgrades --reinstall install hhvm/$(lsb_release -sc)-lts-$1
77 changes: 77 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Tests

on:
push:
pull_request:

jobs:
php:
name: PHP ${{ matrix.php }}
runs-on: ubuntu-20.04

strategy:
matrix:
php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']

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

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer:v2
coverage: none

- name: Setup Problem Matchers
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Install PHP 5/7 Dependencies
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --no-interaction --no-progress
if: "matrix.php < 8"

- name: Install PHP 8 Dependencies
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --no-interaction --no-progress --ignore-platform-req=php
if: "matrix.php >= 8"

- name: Execute PHPUnit
run: vendor/bin/phpunit

hhvm:
name: HHVM ${{ matrix.hhvm }}
runs-on: ubuntu-16.04

strategy:
matrix:
hhvm: ['3.15', '3.18', '3.21', '3.24', '3.27', '3.30']

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

- name: Install HHVM
shell: bash
run: sudo .github/bin/hhvm.sh ${{ matrix.hhvm }}

- name: Install Composer
shell: bash
run: sudo .github/bin/composer.sh

- name: Install Dependencies
uses: nick-invision/retry@v1
with:
timeout_minutes: 5
max_attempts: 5
command: composer update --no-interaction --no-progress

- name: Execute PHPUnit
run: hhvm vendor/bin/phpunit
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/.idea
/vendor
.phpunit.result.cache
composer.lock
phpunit.xml
vendor
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Factory Muffin Faker 2.2
========================

[![StyleCI Status](https://styleci.io/repos/27880728/shield)](https://styleci.io/repos/27880728)
[![Build Status](https://img.shields.io/travis/thephpleague/factory-muffin-faker.svg?style=flat-square)](https://travis-ci.org/thephpleague/factory-muffin-faker)
[![Build Status](https://img.shields.io/github/workflow/status/thephpleague/factory-muffin-faker/Tests?label=Tests&style=flat-square)](https://github.com/thephpleague/factory-muffin-faker/actions?query=workflow%3ATests)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
[![Latest Version](https://img.shields.io/github/release/thephpleague/factory-muffin-faker.svg?style=flat-square)](https://github.com/thephpleague/factory-muffin-faker/releases)
[![Total Downloads](https://img.shields.io/packagist/dt/league/factory-muffin-faker.svg?style=flat-square)](https://packagist.org/packages/league/factory-muffin-faker)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"fzaninotto/faker" : "^1.6"
},
"require-dev": {
"phpunit/phpunit": "^4.8.36|^5.6.3"
"phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20"
},
"autoload": {
"psr-4": {
Expand Down
3 changes: 2 additions & 1 deletion tests/FakerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
*/

use League\FactoryMuffin\Faker\Facade as Faker;
use PHPUnit\Framework\TestCase;

/**
* This is the faker test class.
*
* @author Graham Campbell <graham@alt-three.com>
*/
class FakerTest extends PHPUnit_Framework_TestCase
class FakerTest extends TestCase
{
public function testGetGenerator()
{
Expand Down

0 comments on commit 3b63503

Please sign in to comment.