Skip to content

Commit f867faf

Browse files
committed
Replace Travis CI with GitHub Actions
1 parent 6dd038c commit f867faf

File tree

5 files changed

+72
-85
lines changed

5 files changed

+72
-85
lines changed

.github/workflows/test.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Test
2+
3+
on:
4+
push: ~
5+
pull_request:
6+
branches: [ master ]
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
# Earliest and latest version of each major version
14+
php-versions: ['7.2', '7.4', '8.0', '8.1']
15+
prefer: ['prefer-stable', 'prefer-lowest']
16+
symfony-versions: ['^3.4', '^4', '^5', '^6']
17+
include:
18+
- symfony-versions: '^3.4'
19+
symfony-bundle-test-version: '^1.8'
20+
exclude:
21+
# Symfony 6 requires PHP 8
22+
- php-versions: '7.2'
23+
symfony-versions: '^6'
24+
- php-versions: '7.4'
25+
symfony-versions: '^6'
26+
# Symfony 3.4 with PHP 8 is possible, though we skip it to reduce the number of jobs
27+
- php-versions: '8.0'
28+
symfony-versions: '^3.4'
29+
- php-versions: '8.1'
30+
symfony-versions: '^3.4'
31+
name: Test PHP ${{ matrix.php-versions }}, Symfony ${{ matrix.symfony-versions }}, ${{ matrix.prefer }}
32+
33+
steps:
34+
- uses: actions/checkout@v3
35+
36+
- name: Setup PHP
37+
uses: shivammathur/setup-php@v2
38+
with:
39+
php-version: ${{ matrix.php-versions }}
40+
env:
41+
fail-fast: true
42+
43+
- name: Get composer cache directory
44+
id: composer-cache
45+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
46+
47+
- name: Cache dependencies
48+
uses: actions/cache@v3
49+
with:
50+
path: ${{ steps.composer-cache.outputs.dir }}
51+
key: ${{ runner.os }}-composer-${{ matrix.prefer }}-${{ matrix.symfony-versions }}-${{ hashFiles('**/composer.json') }}
52+
restore-keys: ${{ runner.os }}-composer-${{ matrix.prefer }}-${{ matrix.symfony-versions }}-
53+
54+
- name: Install dependencies
55+
run: |
56+
if [ -n "${{ matrix.symfony-bundle-test-version }}" ]; then
57+
composer require --dev --no-update "nyholm/symfony-bundle-test:${{ matrix.symfony-bundle-test-version }}"
58+
fi
59+
for symfony_package in $(jq -r '.require | keys[]' composer.json | grep '^symfony/'); do
60+
composer require --no-update "${symfony_package}:${{ matrix.symfony-versions }}"
61+
done
62+
composer --prefer-dist --${{ matrix.prefer }} update
63+
64+
- name: Setup problem matchers for PHPUnit
65+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
66+
67+
- name: Run PHPUnit
68+
run: ./vendor/bin/phpunit

.travis.yml

-81
This file was deleted.

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ versioning-bundle
33

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

87
Simple way to version your Symfony Flex application.
98

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
"require-dev": {
2727
"mikey179/vfsstream": "^2",
2828
"nyholm/symfony-bundle-test": "1.x-dev",
29-
"phpunit/phpunit": "^7 || ^8",
30-
"symfony/phpunit-bridge": "^5",
29+
"phpunit/phpunit": "^8.5.27",
30+
"symfony/phpunit-bridge": "^5 || ^6",
3131
"twig/twig": "^2 || ^3"
3232
},
3333
"config": {

phpunit.xml.dist

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.5/phpunit.xsd"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.5/phpunit.xsd"
55
backupGlobals="false"
66
colors="true"
77
bootstrap="vendor/autoload.php"
88
>
99
<php>
1010
<ini name="error_reporting" value="-1"/>
11+
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=0"/>
1112
</php>
1213

1314
<testsuites>

0 commit comments

Comments
 (0)