diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..cdf2aa1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: CI +on: + pull_request: + push: + branches: + - master + +jobs: + tests: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: ['8.1', '8.2', '8.3'] + symfony_version: ['5.4.*', '6.3.*', '6.4.*', '7.0.*'] + dependencies: ['--prefer-lowest', '--prefer-dist'] + + name: PHP ${{ matrix.php }} tests on Sf ${{ matrix.symfony_version }}, deps=${{ matrix.dependencies }} + + steps: + - uses: actions/checkout@v2 + + - name: Get Composer Cache Directory + id: composer-cache + run: | + echo "::set-output name=dir::$(composer config cache-files-dir)" + + - uses: actions/cache@v2 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: composer-${{ matrix.php }}-${{ matrix.symfony_version }}-${{ matrix.dependencies }}-${{ hashFiles('**/composer.json') }} + restore-keys: | + composer-${{ matrix.php }}-${{ matrix.symfony_version }}-${{ matrix.dependencies }}- + + - uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + coverage: none + extensions: :xdebug + + - run: php ./Tests/bin/pin-symfony-version.php "${{ matrix.symfony_version }}" + + - run: composer update --no-progress ${{ matrix.dependencies }} + + - run: ./vendor/bin/phpunit \ No newline at end of file diff --git a/Tests/bin/pin-symfony-version.php b/Tests/bin/pin-symfony-version.php new file mode 100755 index 0000000..4f5502b --- /dev/null +++ b/Tests/bin/pin-symfony-version.php @@ -0,0 +1,15 @@ +#!/usr/bin/env php +