Skip to content

Commit

Permalink
Merge pull request #87 from shivas/github-actions
Browse files Browse the repository at this point in the history
Replace Travis CI with GitHub Actions
  • Loading branch information
dontub authored Jul 10, 2022
2 parents 6dd038c + f867faf commit 427969b
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 85 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Test

on:
push: ~
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
# Earliest and latest version of each major version
php-versions: ['7.2', '7.4', '8.0', '8.1']
prefer: ['prefer-stable', 'prefer-lowest']
symfony-versions: ['^3.4', '^4', '^5', '^6']
include:
- symfony-versions: '^3.4'
symfony-bundle-test-version: '^1.8'
exclude:
# Symfony 6 requires PHP 8
- php-versions: '7.2'
symfony-versions: '^6'
- php-versions: '7.4'
symfony-versions: '^6'
# Symfony 3.4 with PHP 8 is possible, though we skip it to reduce the number of jobs
- php-versions: '8.0'
symfony-versions: '^3.4'
- php-versions: '8.1'
symfony-versions: '^3.4'
name: Test PHP ${{ matrix.php-versions }}, Symfony ${{ matrix.symfony-versions }}, ${{ matrix.prefer }}

steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
env:
fail-fast: true

- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ matrix.prefer }}-${{ matrix.symfony-versions }}-${{ hashFiles('**/composer.json') }}
restore-keys: ${{ runner.os }}-composer-${{ matrix.prefer }}-${{ matrix.symfony-versions }}-

- name: Install dependencies
run: |
if [ -n "${{ matrix.symfony-bundle-test-version }}" ]; then
composer require --dev --no-update "nyholm/symfony-bundle-test:${{ matrix.symfony-bundle-test-version }}"
fi
for symfony_package in $(jq -r '.require | keys[]' composer.json | grep '^symfony/'); do
composer require --no-update "${symfony_package}:${{ matrix.symfony-versions }}"
done
composer --prefer-dist --${{ matrix.prefer }} update
- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Run PHPUnit
run: ./vendor/bin/phpunit
81 changes: 0 additions & 81 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ versioning-bundle

[![SensioLabsInsight](https://insight.sensiolabs.com/projects/d6d73376-b826-46d0-85f5-fd9f77c45c06/mini.png)](https://insight.sensiolabs.com/projects/d6d73376-b826-46d0-85f5-fd9f77c45c06)
[![Total Downloads](https://img.shields.io/packagist/dt/shivas/versioning-bundle.svg?style=flat)](https://packagist.org/packages/shivas/versioning-bundle)
[![Build Status](https://travis-ci.org/shivas/versioning-bundle.svg?branch=master)](https://travis-ci.org/shivas/versioning-bundle)

Simple way to version your Symfony Flex application.

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"require-dev": {
"mikey179/vfsstream": "^2",
"nyholm/symfony-bundle-test": "1.x-dev",
"phpunit/phpunit": "^7 || ^8",
"symfony/phpunit-bridge": "^5",
"phpunit/phpunit": "^8.5.27",
"symfony/phpunit-bridge": "^5 || ^6",
"twig/twig": "^2 || ^3"
},
"config": {
Expand Down
3 changes: 2 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd"
backupGlobals="false"
colors="true"
bootstrap="vendor/autoload.php"
>
<php>
<ini name="error_reporting" value="-1"/>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=0"/>
</php>

<testsuites>
Expand Down

0 comments on commit 427969b

Please sign in to comment.