diff --git a/.github/workflows/analyse.yml b/.github/workflows/analyse.yml index 4960b0a..0ca187b 100644 --- a/.github/workflows/analyse.yml +++ b/.github/workflows/analyse.yml @@ -1,4 +1,4 @@ -name: analyse +name: Analyse on: push: @@ -8,34 +8,31 @@ on: jobs: phpstan: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 8.1 - - - name: Get Composer Cache Directory - id: composer-cache - run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" - - - uses: actions/cache@v3 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer-8.1 - - - name: Install dependencies - if: steps.cache-descom-laravel-auth.outputs.cache-hit != 'true' - run: | - composer install - composer dump - - - name: Run analyse phpstan - run: vendor/bin/phpstan analyse --error-format github \ No newline at end of file + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.3 + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v4 + with: + path: vendor + key: ${{ runner.os }}-php-8.3-${{ hashFiles('**/composer.json') }} + restore-keys: | + ${{ runner.os }}-php-8.3- + + - name: Install dependencies + if: steps.composer-cache.outputs.cache-hit != 'true' + run: | + composer install --no-interaction --no-progress + composer dump + + - name: Run analyse phpstan + run: vendor/bin/phpstan analyse --error-format github diff --git a/.github/workflows/style-fix.yml b/.github/workflows/style-fix.yml index fe82531..7503457 100644 --- a/.github/workflows/style-fix.yml +++ b/.github/workflows/style-fix.yml @@ -1,44 +1,41 @@ -name: style-fix +name: Style fix on: push: branches: [master] jobs: - style: - + style-fix: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 8.1 - - - name: Get Composer Cache Directory - id: composer-cache - run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" - - - uses: actions/cache@v3 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer-8.1 - - - name: Install dependencies - if: steps.cache-descom-laravel-auth.outputs.cache-hit != 'true' - run: | - composer install - composer dump - - - name: Fix styles - run: vendor/bin/php-cs-fixer fix - - - uses: EndBug/add-and-commit@v9 - - - name: Run style - run: vendor/bin/php-cs-fixer fix --dry-run --diff --format junit \ No newline at end of file + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 8.3 + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v4 + with: + path: vendor + key: ${{ runner.os }}-php-8.3-${{ hashFiles('**/composer.json') }} + restore-keys: | + ${{ runner.os }}-php-8.3- + + - name: Install dependencies + if: steps.composer-cache.outputs.cache-hit != 'true' + run: | + composer install --no-interaction --no-progress + composer dump + + - name: Fix styles + run: vendor/bin/php-cs-fixer fix + + - name: Run style + run: vendor/bin/php-cs-fixer fix --dry-run --diff --format junit + + - uses: EndBug/add-and-commit@v9 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5c8bb14..cfbe0b5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: tests +name: Tests on: push: @@ -8,41 +8,39 @@ on: jobs: phpunit: - runs-on: ubuntu-latest strategy: + fail-fast: true matrix: - php-versions: ['8.2', '8.1', '8.0'] + php: [8.1, 8.2, 8.3] steps: - - uses: actions/checkout@v2 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, bcmath, intl, exif - coverage: xdebug - - - - name: Validate composer.json and composer.lock - run: composer validate - - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v2 - with: - path: vendor - key: ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-php-${{ matrix.php-versions }} - - - name: Install dependencies - if: steps.composer-cache.outputs.cache-hit != 'true' - run: | - composer install - composer dump - - - name: Run test phpunit - run: vendor/bin/phpunit \ No newline at end of file + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + + - name: Validate composer.json + run: composer validate + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v4 + with: + path: vendor + key: ${{ runner.os }}-php-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php-${{ matrix.php }}- + + - name: Install dependencies + if: steps.composer-cache.outputs.cache-hit != 'true' + run: | + composer install --no-interaction --no-progress + composer dump + + - name: Run test phpunit + run: vendor/bin/phpunit --stop-on-error --stop-on-failure diff --git a/composer.json b/composer.json index cbac89f..55a915b 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ "require-dev": { "guzzlehttp/psr7": "^1", "omnipay/tests": "^4.1", - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.5|^10.0|^10.5", "friendsofphp/php-cs-fixer": "^3.10", "phpstan/phpstan": "^1.8" }, @@ -40,4 +40,4 @@ "php-http/discovery": false } } -} +} \ No newline at end of file