Skip to content

Latest commit

 

History

History
113 lines (81 loc) · 3.58 KB

README.md

File metadata and controls

113 lines (81 loc) · 3.58 KB
Build Status Commits since latest release Codecov Follow on Twitter (X)

Composer / Install

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.


Example Usage

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.


Structure

Inputs

  • dependencies, optional: Which dependencies to install, one of "lowest", "locked", "highest"
  • working-directory, optional: The working directory to use, defaults to ".".

Outputs

none

Side Effects

  • When dependencies is set to "lowest", dependencies are installed in the directory specified by working-directory with

    composer update --ansi --no-interaction --no-progress --prefer-lowest
  • When dependencies is set to "locked", dependencies are installed in the directory specified by working-directory with

    composer install --ansi --no-interaction --no-progress
  • When dependencies is set to "highest", dependencies are installed in the directory specified by working-directory with

    composer update --ansi --no-interaction --no-progress