Add alignment for path repository version in CI workflow #5
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test Matrix | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| - support/* | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: ['8.2', '8.3'] | |
| laravel: ['^12.0', '^13.0'] | |
| dependencies: ['stable', 'lowest'] | |
| exclude: | |
| - php: '8.2' | |
| laravel: '^13.0' | |
| name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.dependencies }} deps | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Checkout support package for local path repository | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: solutionforest/inspirecms-support | |
| ref: ${{ github.head_ref || github.ref_name }} | |
| path: inspirecms-support | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Prepare local path dependency | |
| run: | | |
| rm -rf ../inspirecms-support | |
| ln -s "$PWD/inspirecms-support" ../inspirecms-support | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| extensions: mbstring, pdo, sqlite, curl, dom, fileinfo, gd, intl | |
| coverage: none | |
| - name: Validate composer | |
| run: composer validate --strict | |
| - name: Set Composer root version | |
| run: echo "COMPOSER_ROOT_VERSION=dev-${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}" >> $GITHUB_ENV | |
| - name: Align path repository version | |
| run: | | |
| SUPPORT_DEV_VERSION="dev-${GITHUB_HEAD_REF:-${GITHUB_REF_NAME}}" | |
| composer config --json repositories.0.options.versions "{\"solution-forest/inspirecms-support\":\"${SUPPORT_DEV_VERSION}\"}" | |
| - name: Configure Laravel version | |
| run: composer require "laravel/framework:${{ matrix.laravel }}" --no-update --with-all-dependencies | |
| - name: Install dependencies (stable) | |
| if: matrix.dependencies == 'stable' | |
| run: composer update --prefer-dist --no-interaction --no-progress --with-all-dependencies | |
| - name: Install dependencies (lowest) | |
| if: matrix.dependencies == 'lowest' | |
| run: composer update --prefer-lowest --prefer-stable --no-interaction --no-progress --with-all-dependencies | |
| - name: Run tests | |
| run: vendor/bin/pest |