From 6c6151ae32b4fa0c9622dffa91312516152a4ac3 Mon Sep 17 00:00:00 2001 From: "Nek (Maxime Veber)" Date: Thu, 17 Dec 2020 21:46:13 +0100 Subject: [PATCH] feat(workflow): add github workflow --- .github/workflows/tests.yml | 38 +++++++++++++++++++++++++++++++++++++ .gitignore | 1 + composer.json | 15 +++++++++++---- 3 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..d9513c6 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,38 @@ +name: Spec tests +on: [pull_request] +jobs: + run-tests: + name: PHP ${{ matrix.php }} (${{ matrix.os }}) + + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + php: [ 7.3, 7.4, 8.0 ] + os: [ ubuntu-latest ] + phpunit-versions: ['latest'] + include: + - os: [ ubuntu-latest ] + php: 8.1 + composer-flag: "--ignore-platform-reqs" + + - os: [ ubuntu-latest ] + php: 7.2 + composer-flag: "--prefer-lowest" + + steps: + - uses: actions/checkout@v2 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + + - name: Install dependencies + run: composer update --prefer-dist ${{ matrix.composer-flag }} + + - name: PHPUnit tests + run: ./vendor/bin/phpunit + + - name: PHPSpec tests + run: ./vendor/bin/phpspec run diff --git a/.gitignore b/.gitignore index 987e2a2..e96516b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ composer.lock vendor +.phpunit.result.cache diff --git a/composer.json b/composer.json index 94cacc9..00fbecc 100644 --- a/composer.json +++ b/composer.json @@ -12,11 +12,18 @@ "php": "^7.0 || ^8.0" }, "require-dev": { - "phpspec/phpspec": "^3.2", - "bossa/phpspec2-expect": "^2.3", - "phpunit/phpunit": "^5.7" + "phpspec/phpspec": "^6.3.0", + "bossa/phpspec2-expect": "dev-feature/php-8", + "phpunit/phpunit": "^8.5" }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/Nek-/phpspec2-expect" + } + ], "_comment": [ - "PHPSpec is limited to ^3.2 to keep compatibility with PHP5.6" + "PHPSpec is limited to ^6.x to keep compatibility with PHP7.1", + "The repository for expect package is temporary, see https://github.com/BossaConsulting/phpspec2-expect/pull/66" ] }