Skip to content

Commit 07fbd1c

Browse files
committed
Run PHPUnit as GitHub Actions workflow
1 parent 16604e3 commit 07fbd1c

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
sed --in-place --regexp-extended --expression='s/"(symfony\/.*)": "\^.*"/"\1": "'$VERSION'"/' composer.json

.github/workflows/tests.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
env:
10+
SYMFONY_DEPRECATIONS_HELPER: weak
11+
PHP_VERSION: 7.2
12+
13+
jobs:
14+
PHPUnit:
15+
16+
runs-on: ubuntu-20.04
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
include:
21+
- { symfony-locked-version: none, dependency-version: prefer-lowest }
22+
- { symfony-locked-version: 3.4.*, dependency-version: prefer-stable }
23+
- { symfony-locked-version: 4.4.*, dependency-version: prefer-stable }
24+
name: PHPUnit (Symfony Version Lock ${{ matrix.symfony-locked-version }}, ${{ matrix.dependency-version }})
25+
steps:
26+
- uses: actions/checkout@v2
27+
- uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: ${{ env.PHP_VERSION }}
30+
tools: composer:v2
31+
- uses: actions/cache@v2
32+
with:
33+
path: vendor
34+
key: composer-${{ runner.os }}-${{ env.PHP_VERSION }}-${{ matrix.symfony-locked-version }}-${{ matrix.dependency-version }}-${{ hashFiles('composer.json', 'composer.lock') }}
35+
restore-keys: |
36+
composer-${{ runner.os }}-${{ env.PHP_VERSION }}-${{ matrix.symfony-locked-version }}-${{ matrix.dependency-version }}-
37+
composer-${{ runner.os }}-${{ env.PHP_VERSION }}-
38+
composer-${{ runner.os }}-
39+
- run: VERSION=${{ matrix.symfony-locked-version }} .github/workflows/lock-symfony-version.sh
40+
if: matrix.symfony-locked-version != 'none'
41+
- run: composer update --${{ matrix.dependency-version }} --no-interaction --no-scripts --no-progress --prefer-dist
42+
- run: composer show
43+
- run: vendor/bin/phpunit

0 commit comments

Comments
 (0)