This action installs dependencies with Composer based on the specified dependency level (lowest, locked, highest). It's designed to be flexible, allowing you to specify the working directory for the Composer command.
Create a new workflow file, for example, .github/workflows/integrate.yml, and add the following code to it.
---
on: # yamllint disable-line rule:truthy
push:
branches:
- master
pull_request:
name: 🔍 Continuous integration
jobs:
integrate:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
php-version:
- '8.1'
- '8.2'
- '8.3'
dependencies:
- lowest
- locked
- highest
steps:
- name: 📦 Check out the codebase
uses: actions/checkout@v4
# ...
- name: 📥 Install "${{ matrix.dependencies }}" dependencies
uses: wayofdev/gh-actions/actions/composer/install@master
with:
dependencies: ${{ matrix.dependencies }}
working-directory: '.'
# ...
...For details, see actions/composer/install/action.yaml.
Real-world examples can be found in the wayofdev/laravel-package-tpl repository.
dependencies, optional: Which dependencies to install, one of"lowest","locked","highest"working-directory, optional: The working directory to use, defaults to".".
none
-
When
dependenciesis set to"lowest", dependencies are installed in the directory specified byworking-directorywithcomposer update --ansi --no-interaction --no-progress --prefer-lowest
-
When
dependenciesis set to"locked", dependencies are installed in the directory specified byworking-directorywithcomposer install --ansi --no-interaction --no-progress
-
When
dependenciesis set to"highest", dependencies are installed in the directory specified byworking-directorywithcomposer update --ansi --no-interaction --no-progress