Skip to content

Commit

Permalink
Migrate CI to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
stof committed Oct 14, 2021
1 parent 7f6a1dc commit 02ab91b
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 50 deletions.
83 changes: 83 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: CI

on:
push:
branches:
- master
- '[0-9]+.[0-9x]+'
pull_request:

jobs:
check_composer:
name: Check composer.json
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
coverage: none
php-version: '7.4'
- run: composer validate --strict --no-check-lock

tests:
name: "Tests on PHP ${{ matrix.php }}${{ matrix.name_suffix }}"
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: [ '7.1', '7.2', '7.3', '7.4' ]
min_stability: [ '' ]
name_suffix: [ '' ]
composer_flags: [ '' ]
symfony_version: [ '' ]
coverage: [ 'none' ]
include:
- php: '7.4'
min_stability: 'dev'
name_suffix: ' (dev deps)'
coverage: 'xdebug'
- php: '7.1'
min_stability: ''
name_suffix: ' (lowest deps)'
composer_flags: '--prefer-lowest'
- php: '7.4'
name_suffix: ' (Symfony LTS 4.x)'
symfony_version: '^4'

steps:
- uses: actions/checkout@v2
- uses: shivammathur/setup-php@v2
with:
coverage: "${{ matrix.coverage }}"
php-version: "${{ matrix.php }}"

- name: Configure stability
if: "matrix.min_stability != ''"
run: composer config minimum-stability "${{ matrix.min_stability }}"

- name: force Symfony version
run: composer require "symfony/lts:${{ matrix.symfony_version }}" --dev --no-update
if: "matrix.symfony_version != ''"

- name: Install dependencies
run: composer update --ansi --no-progress --prefer-dist --no-interaction ${{ matrix.composer_flags }}

- name: Install PHPUnit
run: vendor/bin/simple-phpunit install

- name: Run tests
if: "matrix.coverage == 'none'"
run: vendor/bin/simple-phpunit -v --colors=always

- name: Run tests with code coverage
if: "matrix.coverage != 'none'"
run: vendor/bin/simple-phpunit -v --colors=always --coverage-clover=coverage.clover

- name: Install coverage uploader
if: "matrix.coverage != 'none'"
run: wget https://scrutinizer-ci.com/ocular.phar

- name: Upload code coverage to Scrutinizer
if: "matrix.coverage != 'none'"
run: php ocular.phar code-coverage:upload --format=php-clover coverage.clover
49 changes: 0 additions & 49 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"symfony/phpunit-bridge": "^4.4||^5.0",
"symfony/validator": "^4.4||^5.0"
},
"minimum-stability": "dev",
"extra": {
"branch-alias": {
"dev-master": "2.0.x-dev"
Expand Down

0 comments on commit 02ab91b

Please sign in to comment.