diff --git a/.gitattributes b/.gitattributes index e7f19d1..62895b2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 0f98282..ae6f015 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -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. diff --git a/.github/bin/composer.sh b/.github/bin/composer.sh new file mode 100755 index 0000000..a872006 --- /dev/null +++ b/.github/bin/composer.sh @@ -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 diff --git a/.github/bin/hhvm.sh b/.github/bin/hhvm.sh new file mode 100755 index 0000000..a0448d6 --- /dev/null +++ b/.github/bin/hhvm.sh @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..a659d06 --- /dev/null +++ b/.github/workflows/tests.yml @@ -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 diff --git a/.gitignore b/.gitignore index 52f6354..f973ee0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -/.idea -/vendor +.phpunit.result.cache composer.lock phpunit.xml +vendor diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 539ecc3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,30 +0,0 @@ -language: php - -matrix: - include: - - php: hhvm-3.18 - dist: trusty - - php: hhvm-3.30 - dist: trusty - - php: 5.4 - dist: trusty - - php: 5.5 - dist: trusty - - php: 5.6 - dist: xenial - - php: 7.0 - dist: xenial - - php: 7.1 - dist: bionic - - php: 7.2 - dist: bionic - - php: 7.3 - dist: bionic - - php: 7.4 - dist: bionic - -install: - - travis_retry composer install --prefer-dist -n -o - -script: - - vendor/bin/phpunit diff --git a/README.md b/README.md index 9a6e0e2..6d865ee 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/composer.json b/composer.json index e0918c5..ce25acd 100644 --- a/composer.json +++ b/composer.json @@ -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": { diff --git a/tests/FakerTest.php b/tests/FakerTest.php index 5aa7c0a..d2d4697 100644 --- a/tests/FakerTest.php +++ b/tests/FakerTest.php @@ -10,13 +10,14 @@ */ use League\FactoryMuffin\Faker\Facade as Faker; +use PHPUnit\Framework\TestCase; /** * This is the faker test class. * * @author Graham Campbell */ -class FakerTest extends PHPUnit_Framework_TestCase +class FakerTest extends TestCase { public function testGetGenerator() {