From 906179c3868df60fc0d06b841cc8dbb874c81e7c Mon Sep 17 00:00:00 2001 From: fsevestre Date: Thu, 29 Dec 2022 15:57:45 +0100 Subject: [PATCH] Allow Symfony + add Github actions --- .github/workflows/build.yaml | 62 ++++++++++++++++++++++++++++++++++++ LICENSE | 2 +- README.md | 5 --- composer.json | 5 +-- 4 files changed, 66 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..e1c65af --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,62 @@ +name: Continuous Integration + +on: + pull_request: ~ + push: ~ + +jobs: + check: + runs-on: ubuntu-20.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + - name: Validate composer.json + run: composer validate --strict --no-check-lock + tests: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + include: + - description: 'No Symfony specified' + php: '7.2' + - description: 'No Symfony specified' + php: '7.3' + - description: 'No Symfony specified' + php: '7.4' + - description: 'No Symfony specified' + php: '8.0' + - description: 'No Symfony specified' + php: '8.1' + - description: 'No Symfony specified' + php: '8.2' + - description: 'Lowest deps' + php: '7.2' + composer_option: '--prefer-lowest' + env: + SYMFONY_DEPRECATIONS_HELPER: max[self]=0 + - description: 'Dev deps' + php: '8.1' + dev: true + name: PHP ${{ matrix.php }} tests (${{ matrix.description }}) + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Cache + uses: actions/cache@v3 + with: + path: ~/.composer/cache/files + key: composer-${{ matrix.php }}-${{ matrix.symfony }}-${{ matrix.composer_option }} + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + - run: | + sed -ri 's/"symfony\/(.+)": "(.+)"/"symfony\/\1": "'${{ matrix.symfony }}'"/' composer.json; + if: matrix.symfony + - run: composer config minimum-stability dev + if: matrix.dev + - run: composer update --no-interaction --no-progress --ansi ${{ matrix.composer_option }} + - run: bin/phpunit diff --git a/LICENSE b/LICENSE index e0665ea..295ab78 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 Florent SEVESTRE +Copyright (c) 2017-2022 Florent SEVESTRE Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index ed88b01..954e812 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,6 @@ Boolean form type ================= -[![Build Status](https://travis-ci.org/fsevestre/BooleanFormType.svg?branch=master)](https://travis-ci.org/fsevestre/BooleanFormType) -[![Coverage Status](https://coveralls.io/repos/github/fsevestre/BooleanFormType/badge.svg?branch=master)](https://coveralls.io/github/fsevestre/BooleanFormType?branch=master) -[![Scrutinizer Quality Score](https://scrutinizer-ci.com/g/fsevestre/BooleanFormType/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/fsevestre/BooleanFormType) - - Boolean form type for Symfony REST APIs. diff --git a/composer.json b/composer.json index eda630c..1756159 100644 --- a/composer.json +++ b/composer.json @@ -10,10 +10,11 @@ "homepage": "https://github.com/fsevestre/BooleanFormType", "require": { "php": ">=7.2.5", - "symfony/form": "~5.0" + "symfony/form": "^5.0 | ^6.0" }, "require-dev": { - "phpunit/phpunit": "^8.5" + "phpunit/phpunit": "^8.5", + "symfony/phpunit-bridge": "^5.0 | ^6.0" }, "autoload": { "psr-4": { "FSevestre\\BooleanFormType\\": "src/" }