diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f19cfba..76bac6e 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -11,6 +11,9 @@ jobs: php-stan: name: PHP Stan runs-on: ubuntu-latest + strategy: + matrix: + php: [ 7.3, 7.4, 8.1, 8.2 ] steps: - name: Checkout code uses: actions/checkout@v4 @@ -18,17 +21,32 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: "${{ matrix.php }}" + tools: composer, phpstan + + - name: Get composer cache directory + id: composer-cache + run: 'echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT' + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: "${{ steps.composer-cache.outputs.dir }}" + key: "${{ runner.os }}-php-${{ matrix.php}}-composer-${{ hashFiles('**/composer.json') }}" + restore-keys: "${{ runner.os }}-php-${{ matrix.php}}-composer-" - name: Install dependencies run: composer install --no-ansi --no-interaction --no-progress --no-scripts - name: Run PHPStan - run: ./vendor/bin/phpstan + run: phpstan php-unit: name: PHP Unit runs-on: ubuntu-latest + strategy: + matrix: + php: [ 7.3, 7.4, 8.1, 8.2 ] steps: - name: Checkout code uses: actions/checkout@v4 @@ -36,7 +54,19 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 7.4 + php-version: "${{ matrix.php }}" + tools: composer + + - name: Get composer cache directory + id: composer-cache + run: 'echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT' + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: "${{ steps.composer-cache.outputs.dir }}" + key: "${{ runner.os }}-php-${{ matrix.php}}-composer-${{ hashFiles('**/composer.json') }}" + restore-keys: "${{ runner.os }}-php-${{ matrix.php}}-composer-" - name: Install dependencies run: composer install --no-ansi --no-interaction --no-progress --no-scripts diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 891849f..48dbbcf 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -9,18 +9,18 @@ convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false"> - - - ./src - - - - - - - - ./tests/Unit - - - + + + ./src + + + + + + + + ./tests/Unit + + +