Skip to content

Commit

Permalink
Add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ldaspt committed Mar 9, 2023
1 parent b77196d commit da5b05b
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 1 deletion.
61 changes: 61 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: "CI Tests"

on:
push:
pull_request:

jobs:
tests:
name: "PHP ${{ matrix.php }} - Symfony ${{ matrix.symfony }}${{ matrix.composer-flags != '' && format(' - Composer {0}', matrix.composer-flags) || '' }}"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php:
- '7.4'
- '8.0'
- '8.1'
- '8.2'
symfony:
- '3.4.*'
- '4.4.*'
- '5.4.*'
composer-flags:
- '--prefer-stable'
include:
# Lowest Deps
- php: 7.4
symfony: 3.4.*
composer-flags: '--prefer-stable --prefer-lowest'
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
with:
fetch-depth: 2

- name: "Cache Composer packages"
uses: "actions/cache@v3"
with:
path: "~/.composer/cache"
key: "php-${{ matrix.php }}-symfony-${{ matrix.symfony }}-composer-${{ hashFiles('composer.json') }}-flags-${{ matrix.composer-flags }}"
restore-keys: "php-"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "${{ matrix.php }}"
tools: "composer:v2,flex"

- name: "Set Composer stability"
run: "composer config minimum-stability dev"

- name: "Install dependencies"
run: "composer update ${{ matrix.composer-flags }} --prefer-dist"
env:
SYMFONY_REQUIRE: "${{ matrix.symfony }}"

- name: "Validate composer"
run: "composer validate --strict --no-check-lock --no-check-all"

- name: "Run PHPUnit Tests"
run: "vendor/bin/phpunit"
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.phpunit.result.cache
composer.lock
phpunit.xml
vendor
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"symfony/phpunit-bridge": "^3.4 || ^4.0 || ^5.0",
"matthiasnoback/symfony-config-test": "^3.1 || ^4.0"
},
"suggests": {
"suggest": {
"cleentfaar/tissue-clamavphp-adapter": "If you want to scan your files using the PHP-extension of the ClamAV engine"
},
"minimum-stability": "dev",
Expand Down
4 changes: 4 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
colors="true"
bootstrap="Tests/bootstrap.php"
>
<php>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="max[direct]=0"/>
</php>

<testsuites>
<testsuite name="CL TissueBundle Test Suite">
<directory>./Tests/</directory>
Expand Down

0 comments on commit da5b05b

Please sign in to comment.