Skip to content

[CI] Composer dependency improvements #243

Closed
@jaapio

Description

@jaapio

Currently, we are building only with the versions of depencies in our composer.lock file while we accept a wider range version of libs in this package. After some discussion we decided that we should ajust the ci pipeline and extend the unittest matrix to check with multiple versions using something like the snippet below:

      - name: "Cache dependencies installed with composer"
        uses: "actions/cache@v2"
        with:
          path: "${{ steps.determine-composer-cache-directory.outputs.directory }}"
          key: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.lock') }}"
          restore-keys: "php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-"

      - name: "Install lowest dependencies from composer.json"
        if: "matrix.dependencies == 'lowest'"
        run: "composer update --no-interaction --no-progress --no-suggest --prefer-lowest"

      - name: "Install locked dependencies from composer.lock"
        if: "matrix.dependencies == 'locked'"
        run: "composer install --no-interaction --no-progress --no-suggest"

      - name: "Install highest dependencies from composer.json"
        if: "matrix.dependencies == 'highest'"
        run: "composer update --no-interaction --no-progress --no-suggest"

We will keep the composer.lock in this repo because it allows us to pin on certain versions for development. Which seems to be usefull for us at the moment.

We need to check if other buildsteps should also use this matrix, but for now we will start with the unittests.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions