diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e125209 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,34 @@ +name: Application CI + +on: pull_request + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + tests: + runs-on: ubuntu-latest + name: PHP CI ${{ matrix.php-versions }} + strategy: + matrix: + php-versions: + - 8.2 + - 8.3 + + steps: + - name: Checkout sources + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Add HTTP basic auth credentials + run: echo '${{ secrets.COMPOSER_AUTH }}' > $GITHUB_WORKSPACE/auth.json + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + tools: composer:v2 + - name: Install dependencies + run: composer install --no-interaction --no-progress + - name: Run unit tests + run: bin/atoum -ulr diff --git a/.github/workflows/test.yml b/.github/workflows/static-analysis.yml similarity index 63% rename from .github/workflows/test.yml rename to .github/workflows/static-analysis.yml index 650a464..4ca85b8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/static-analysis.yml @@ -1,25 +1,23 @@ on: push -name: test +name: Static Analysis jobs: - php-cs-fixer: + phpcsfixer: name: PHP Coding Standards Fixer runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Add HTTP basic auth credentials run: echo '${{ secrets.COMPOSER_AUTH }}' > $GITHUB_WORKSPACE/auth.json - - name: Setup PHP + - name: Setup PHP environment uses: shivammathur/setup-php@v2 with: php-version: 8.3 + tools: composer - name: Install dependencies - uses: php-actions/composer@v6 - with: - php_version: 8.3 - args: --no-scripts --dev - - name: Php cs fixer - run: bin/php-cs-fixer fix + run: composer install --no-interaction --no-progress + - name: PHP Coding Standards Fixer + run: bin/php-cs-fixer fix --dry-run --diff phpstan: name: PHPStan Static Analysis @@ -28,14 +26,12 @@ jobs: - uses: actions/checkout@v3 - name: Add HTTP basic auth credentials run: echo '${{ secrets.COMPOSER_AUTH }}' > $GITHUB_WORKSPACE/auth.json - - name: Setup PHP + - name: Setup PHP environment uses: shivammathur/setup-php@v2 with: php-version: 8.3 + tools: composer - name: Install dependencies - uses: php-actions/composer@v6 - with: - php_version: 8.3 - args: --no-scripts --dev + run: composer install --no-interaction --no-progress - name: PHPStan Static Analysis - run: bin/phpstan --memory-limit=1G + run: bin/phpstan --memory-limit=1G --error-format=github diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 83c0134..0000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -language: php - -dist: focal -sudo: required - -cache: - directories: - - vendor - - bin - -php: - - 8.0 - -install: - - sudo apt-get update - - cd $TRAVIS_BUILD_DIR - - composer self-update - - composer install --optimize-autoloader --prefer-dist --no-scripts - -before_script: - - echo "xdebug.mode = coverage" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini - -script: - - bin/atoum -ulr - diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 4992be9..b2523fa 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -209,3 +209,8 @@ parameters: message: "#^Method Rezzza\\\\SecurityBundle\\\\Security\\\\Firewall\\\\RequestSignatureProdiver\\:\\:supportsClass\\(\\) has parameter \\$class with no type specified\\.$#" count: 1 path: Security/Firewall/RequestSignatureProdiver.php + + - + message: "#^Method Rezzza\\\\SecurityBundle\\\\Security\\\\SignatureValidUser\\:\\:getUserIdentifier\\(\\) should return non\\-empty\\-string but returns ''\\.$#" + count: 1 + path: Security/SignatureValidUser.php