diff --git a/.github/workflows/run-laravel-testbench-tests.yml b/.github/workflows/run-laravel-testbench-tests.yml index ecfdf94..7e6d003 100644 --- a/.github/workflows/run-laravel-testbench-tests.yml +++ b/.github/workflows/run-laravel-testbench-tests.yml @@ -4,46 +4,55 @@ on: workflow_call: inputs: php-versions: - description: 'Json array of PHP versions' + description: "Json array of PHP versions" default: '["8.2","8.3"]' type: string + # deprecated / ignored laravel-versions: - description: 'Json array of Laravel versions' + description: "Json array of Laravel versions" default: '["10.*"]' type: string + # deprecated / ignored testbench-versions: - description: 'Json array of testbench versions' + description: "Json array of testbench versions" default: '["8.*"]' type: string + # deprecated / ignored concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: + php-matrix: + runs-on: ubuntu-latest + outputs: + versions: ${{ steps.php-matrix.outputs.versions }} + steps: + - uses: actions/checkout@v4 + with: # PHP Matrix only needs composer.json + sparse-checkout: composer.json + sparse-checkout-cone-mode: false + persist-credentials: false + - id: php-matrix + uses: typisttech/php-matrix-action@0545a7d54db2c7be158b615b1e7f458ae6e99ad3 # v3 + test: - runs-on: ${{ matrix.os }} - timeout-minutes: 5 + needs: php-matrix + runs-on: ubuntu-latest strategy: - fail-fast: true + fail-fast: false matrix: - os: [ubuntu-latest] - php: ${{ fromJSON(inputs.php-versions) }} - laravel: ${{ fromJSON(inputs.laravel-versions) }} - testbench: ${{ fromJSON(inputs.testbench-versions) }} - - name: PHP${{ matrix.php }} - Laravel${{ matrix.laravel }} - + php: ${{ fromJSON(needs.php-matrix.outputs.versions) }} + name: PHP${{ matrix.php }} permissions: contents: read pull-requests: write - steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -66,34 +75,16 @@ jobs: } } } - - name: Setup problem matchers run: | echo "::add-matcher::${{ runner.tool_cache }}/php.json" echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - - name: Get Composer Cache Directory - id: composer-cache - run: | - echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - name: Install dependencies - run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update - composer update --prefer-dist --no-interaction - + run: composer update --no-interaction --no-progress - name: List Installed Dependencies run: composer show -D - - name: Execute tests run: vendor/bin/pest --coverage-clover=coverage.xml - - name: Coverage Report as Comment (Clover) if: github.event_name == 'pull_request' uses: lucassabreu/comment-coverage-clover@main diff --git a/.github/workflows/run-pest-tests.yml b/.github/workflows/run-pest-tests.yml index 330ec30..cac3340 100644 --- a/.github/workflows/run-pest-tests.yml +++ b/.github/workflows/run-pest-tests.yml @@ -4,36 +4,45 @@ on: workflow_call: inputs: php-versions: - description: 'Json array of PHP versions' + description: "Json array of PHP versions" default: '["8.2","8.3"]' type: string + # deprecated / ignored concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: + php-matrix: + runs-on: ubuntu-latest + outputs: + versions: ${{ steps.php-matrix.outputs.versions }} + steps: + - uses: actions/checkout@v4 + with: # PHP Matrix only needs composer.json + sparse-checkout: composer.json + sparse-checkout-cone-mode: false + persist-credentials: false + - id: php-matrix + uses: typisttech/php-matrix-action@0545a7d54db2c7be158b615b1e7f458ae6e99ad3 # v3 + test: - runs-on: ${{ matrix.os }} - timeout-minutes: 5 + needs: php-matrix + runs-on: ubuntu-latest strategy: - fail-fast: true + fail-fast: false matrix: - os: [ubuntu-latest] - php: ${{ fromJSON(inputs.php-versions) }} - + php: ${{ fromJSON(needs.php-matrix.outputs.versions) }} name: PHP${{ matrix.php }} - permissions: contents: read pull-requests: write - steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -56,33 +65,16 @@ jobs: } } } - - name: Setup problem matchers run: | echo "::add-matcher::${{ runner.tool_cache }}/php.json" echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - - name: Get Composer Cache Directory - id: composer-cache - run: | - echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - - uses: actions/cache@v4 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - - name: Install dependencies - run: | - composer update --prefer-dist --no-interaction - + run: composer update --no-interaction --no-progress - name: List Installed Dependencies run: composer show -D - - name: Execute tests run: vendor/bin/pest --coverage-clover=coverage.xml - - name: Coverage Report as Comment (Clover) if: github.event_name == 'pull_request' uses: lucassabreu/comment-coverage-clover@main