Coder Social home page Coder Social logo

composer-install's Introduction

ramsey/composer-install

A GitHub Action to streamline installation of PHP dependencies with Composer.

Source Code Read License Build Status Codecov Code Coverage

About

ramsey/composer-install is a GitHub Action to streamline installation of Composer dependencies in workflows. It installs your Composer dependencies and caches them for improved build times.

This project adheres to a code of conduct. By participating in this project and its community, you are expected to uphold this code.

Dependencies

This GitHub Action requires PHP and Composer. One way to ensure you have both is to use the Setup PHP GitHub Action.

The step that sets up PHP and Composer for your environment must come before the ramsey/composer-install step.

Usage

Use ramsey/composer-install as step within a job. This example also shows use of the Setup PHP action as a step.

- uses: "shivammathur/setup-php@v2"
  with:
    php-version: "latest"
- uses: "ramsey/composer-install@v3"

💡 There is no need to set up a separate caching step since ramsey/composer-install handles this for you.

Input Parameters

dependency-versions

The dependency-versions input parameter allows you to select whether the job should install the locked, highest, or lowest versions of Composer dependencies.

Valid values are:

  • locked: (default) installs the locked versions of Composer dependencies (equivalent to running composer install)

  • highest: installs the highest versions of Composer dependencies (equivalent to running composer update)

  • lowest: installs the lowest versions of Composer dependencies (equivalent to running composer update --prefer-lowest --prefer-stable)

For example:

- uses: "ramsey/composer-install@v3"
  with:
    dependency-versions: "lowest"

composer-options

ramsey/composer-install always passes the --no-interaction, --no-progress, and --ansi options to the composer command. If you'd like to pass additional options, you may use the composer-options input parameter.

For example:

- uses: "ramsey/composer-install@v3"
  with:
    composer-options: "--ignore-platform-reqs --optimize-autoloader"

working-directory

The working-directory input parameter allows you to specify a different location for your composer.json file. For example, if your composer.json is located in packages/acme-foo/, use working-directory to tell ramsey/composer-install where to run things.

- uses: "ramsey/composer-install@v3"
  with:
    working-directory: "packages/acme-foo"

You may use this step as many times as needed, if you have multiple composer.json files.

For example:

# Install dependencies using composer.json in the root.
- uses: "ramsey/composer-install@v3"

# Install dependencies using composer.json in src/Component/Config/
- uses: "ramsey/composer-install@v3"
  with:
    working-directory: "src/Component/Config"

# Install dependencies using composer.json in src/Component/Validator/
- uses: "ramsey/composer-install@v3"
  with:
    working-directory: "src/Component/Validator"

ignore-cache

If you have jobs for which you wish to completely ignore the caching step, you may use the ignore-cache input parameter. When present, ramsey/composer-install will neither read from nor write to the cache.

Values of 'yes', true, or 1 will tell the action to ignore the cache. For any other value, the action will use the default behavior, which is to read from and store to the cache.

- uses: "ramsey/composer-install@v3"
  with:
    ignore-cache: "yes"

custom-cache-key

There may be times you wish to specify your own cache key. You may do so with the custom-cache-key input parameter. When provided, ramsey/composer-install will not use the auto-generated cache key, so if your composer.json or composer.lock files change, you'll need to update the custom cache key if you wish to update the cache.

- uses: "ramsey/composer-install@v3"
  with:
    custom-cache-key: "my-custom-cache-key"

custom-cache-suffix

ramsey/composer-install will auto-generate a cache key which is composed of the following elements:

  • The OS image name, like ubuntu-latest.
  • The exact PHP version, like 8.1.11.
  • The options passed via composer-options.
  • The dependency version setting as per dependency-versions.
  • The working directory as per working-directory.
  • A hash of the composer.json and/or composer.lock files.

If you don't want to generate your own cache key, but do want to make the cache key even more specific, you can specify a suffix to be added to the cache key via the custom-cache-suffix parameter.

# Adds a suffix to the cache key which is equivalent to the full date-time
# of "last Monday 00:00", which means that the cache will be force refreshed
# via the first workflow which is run every Monday.
- uses: "ramsey/composer-install@v3"
  with:
    custom-cache-suffix: $(/bin/date -u --date='last Mon' "+%F")

⚠️ Note: specifying a custom-cache-key will take precedence over the custom-cache-suffix.

Fork and private repositories

Sometimes it's needed to use the repositories key in your composer.json to pull in forks, PRs with patches or private repositories. In this case, your GitHub Action may start failing with a Could not authenticate against github.com error message. To solve this, you need to add a GitHub Personal Access token, and this bit to your Action configuration:

env:
   COMPOSER_AUTH: '{"github-oauth": {"github.com": "${{ secrets.COMPOSER_AUTH }}"}}'

In this example, COMPOSER_AUTH is the name of the secret that you'll need to create. To access public repositories, the public_repo scope is sufficient, while for private repositories (that you can access), read:project will be needed.

For more information on how to do that on your repository, see Creating a personal access token and Creating encrypted secrets for a repository on GitHub documentation.

Matrix Example

GitHub Workflows allow you to set up a job matrix, which allows you to configure multiple jobs for the same steps by using variable substitution in the job definition.

Here's an example of how you might use the dependency-versions and composer-options input parameters as part of a job matrix.

strategy:
  matrix:
    php:
      - "7.4"
      - "8.0"
      - "8.1"
      - "8.2"
    dependencies:
      - "lowest"
      - "highest"
    include:
      - php-version: "8.3"
        composer-options: "--ignore-platform-reqs"

steps:
  - uses: "actions/checkout@v4"
  - uses: "shivammathur/setup-php@v2"
    with:
      php-version: "${{ matrix.php }}"
  - uses: "ramsey/composer-install@v3"
    with:
      dependency-versions: "${{ matrix.dependencies }}"
      composer-options: "${{ matrix.composer-options }}"

Contributing

Contributions are welcome! Before contributing to this project, familiarize yourself with CONTRIBUTING.md.

Copyright and License

The ramsey/composer-install GitHub Action is copyright © Ben Ramsey and licensed for use under the terms of the MIT License (MIT). Please see LICENSE for more information.

composer-install's People

Contributors

chris53897 avatar dependabot[bot] avatar jean85 avatar jrfnl avatar kocal avatar nhedger avatar oskarstark avatar ramsey avatar szepeviktor avatar tamasszigeti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

composer-install's Issues

Caching the `composer.lock` on prefer-lowest

If we test a library against lowest the composer update --prefer-lowest will take a lot of time, because its it take a lot of more resources to find out the lowest dependencies then the newest dependencies.

But as I think aslong as the PHP Version, PHP Extensions and the composer.json does not change the result of the dependencies for --prefer-lowest would always be the same.

I think we could save a lot of resources when we cache the generated composer.lock based on a hash value of PHP Version, PHP Extensions and the composer.json and restore on a rerun with lowest dependencies the lowest composer.lock and do just a composer install.

So the composer update --prefer-lowest is only done once when the cache does not exist one of the 3 mentioned based hash values changed.

That on highest or without a dependencies configuration this should have no effect. They should still do the same and install the newest/latest dependencies or use the commited composer.lock.

Allow input for php executable

Not sure if this is even possible or in scope for this action, but we install dependencies inside a Docker container where we also have our required extensions available. We can't use this action with that unfortunately. I think that if you're able to set the php/composer executable that this could work something like this:

- uses: "ramsey/composer-install@v1"
  with:
    php: "docker-compose run --rm php"

The main reason we do it this way is because some packages install different versions depending on the php environment (like Ocramius/ProxyManager if I remember correctly). We could replicate our environment using shivammathur/setup-php of course, but that would mean maintaining our php environment in 2 places.

Is this something you'd consider?

[support] Create new tagged release

I've checked whether the fix from #233 has been included in a tagged release, but it appears it hasn't. The 2.2.0 release is about 1.5 years old, and there are pending changes in the dev branch. Could you please create a new tagged release with those changes? Are there any blockers preventing this from being done? Thanks!

2.2.0...v2

Misleading error message when validate_composer fails due to missing HOME/COMPOSER_HOME

Description

If neither HOME nor COMPOSER_HOME env vars are set, validate_composer will exit with non-zero but the error message is redirected to /dev/null.
I had to fork the repo, remove the output redirection to see the issue:

Error: The HOME or COMPOSER_HOME environment variable must be set for composer to run correctly

My suggestion would be to either add a check for HOME/COMPOSER_HOME being set and adding a targeted error message if not or to show the output of composer validate in case it fails.

The latter would also help with future issues composer validate might have.

Steps to reproduce

  1. Ensure composer.json is valid by running composer validate locally.
  2. Run composer-install in an env where HOME/COMPOSER_HOME are not set (e.g. in a self-hosted runner or maybe by unsetting them via env: [HOME: '', COMPOSER_HOME: ''])
  3. See the action fail.

Expected behavior

composer-install finishes successfully.

Output

Run ${GITHUB_ACTION_PATH}/bin/composer_paths.sh \
Error: The composer.json file at './composer.json' does not validate; run 'composer validate' to check for errors
Error: Process completed with exit code 1.

Environment details

  • version of this package: 2.2.0
  • PHP version: 8.0, 8.1, 8.2
  • OS: Self-hosted runner with Linux x64 (Ubuntu 22.04 LTS)

Additional context

Complete tests.yaml

name: tests

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  tests:
    strategy:
      matrix:
        php-versions: ['8.0', '8.1', '8.2']
        dependency-versions: ['lowest', 'highest']
        
    runs-on: [ self-hosted ]

    steps:
    - name: Checkout
      uses: actions/checkout@v4

    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: ${{ matrix.php-versions }}

    - name: Cache Composer packages
      id: composer-cache
      uses: actions/cache@v3
      with:
        path: vendor
        key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
        restore-keys: |
          ${{ runner.os }}-php-

    - name: Install dependencies
      uses: researchgate/composer-install@v2
      with:
        dependency-versions: ${{ matrix.dependency-versions }}

    - name: Run test suite
      run: vendor/bin/phpunit

Cache restore race condition?

Hey there 👋🏻 , thank you for this action! It makes my workflows (and thus) life much easier than having to deal with Composer and actions/cache myself.

However, I did a few test runs and noticed that I get failures every now and then, let's say in 1 out of 5 workflow runs. Those failures are transient and most of the time go away if I run the workflow again.

The bottom line error message is

2021-06-09T05:51:45.7317484Z ##[error]Failed to execute git clone --mirror -- 'ssh://[email protected]/MYORG/MYORG-SOME-PRIVATE-REPO' '/home/runner/.cache/composer/vcs/ssh---git-github.com-MYORG-MYORG-SOME-PRIVATE-REPO/'

Cloning into bare repository '/home/runner/.cache/composer/vcs/ssh---git-github.com-MYORG-MYORG-SOME-PRIVATE-REPO'...
BUG: refs/files-backend.c:2953: initial ref transaction called with existing refs
Aborted (core dumped)

Unfortunately, the Composer dependency in question is for a private repo that will be git-cloned as source, and I can't share all the details. But here is an excerpt from the raw logs with what I think is relevant.

2021-06-09T05:51:23.2825442Z ##[group]Operating System
2021-06-09T05:51:23.2827149Z Ubuntu
2021-06-09T05:51:23.2828278Z 18.04.5
2021-06-09T05:51:23.2829465Z LTS
2021-06-09T05:51:23.2830596Z ##[endgroup]
2021-06-09T05:51:23.2831828Z ##[group]Virtual Environment
2021-06-09T05:51:23.2833168Z Environment: ubuntu-18.04
2021-06-09T05:51:23.2834390Z Version: 20210531.0
2021-06-09T05:51:23.2837061Z Included Software: https://github.com/actions/virtual-environments/blob/ubuntu18/20210531.0/images/linux/Ubuntu1804-README.md
2021-06-09T05:51:23.2839459Z Image Release: https://github.com/actions/virtual-environments/releases/tag/ubuntu18%2F20210531.0
2021-06-09T05:51:23.2841153Z ##[endgroup]
...
2021-06-09T05:51:40.1782268Z ##[group]Run ramsey/composer-install@v1
2021-06-09T05:51:40.1783292Z with:
2021-06-09T05:51:40.1784197Z   dependency-versions: locked
2021-06-09T05:51:40.1785094Z env:
2021-06-09T05:51:40.1785850Z   APP_ENV: test
2021-06-09T05:51:40.1786845Z   PHP_VERSION: 7.2
2021-06-09T05:51:40.1787798Z   SSH_AUTH_SOCK: /tmp/ssh-MZQQ7o4xWr9F/agent.2587
2021-06-09T05:51:40.1789259Z   SSH_AGENT_PID: 2588
2021-06-09T05:51:40.1790655Z   TEMP: /home/runner/work/MYREPO/MYREPO/tmp
2021-06-09T05:51:40.1793996Z   COMPOSER_AUTH: ***
2021-06-09T05:51:40.1794829Z ##[endgroup]
2021-06-09T05:51:40.5953452Z Composer cache directory found at /home/runner/.cache/composer
2021-06-09T05:51:40.5977780Z Composer working directory set to project root.
2021-06-09T05:51:40.5981742Z Using locked versions of dependencies
2021-06-09T05:51:40.6680768Z PHP version is 7.2.34-21+ubuntu18.04.1+deb.sury.org+1
2021-06-09T05:51:40.6682462Z Operating system is linux
2021-06-09T05:51:40.6686362Z Cache primary key is linux-php-7.2.34-21+ubuntu18.04.1+deb.sury.org+1-locked-82ffafb70b7e4a023b19b2e8ef1eef08eb2e61b31dd27e40b751819a7f8331fe-
2021-06-09T05:51:40.6693769Z Cache restore keys are: linux-php-7.2.34-21+ubuntu18.04.1+deb.sury.org+1-locked-82ffafb70b7e4a023b19b2e8ef1eef08eb2e61b31dd27e40b751819a7f8331fe-, linux-php-7.2.34-21+ubuntu18.04.1+deb.sury.org+1-locked-
2021-06-09T05:51:40.7612805Z [command]/usr/local/bin/composer install --no-interaction --no-progress --ansi
2021-06-09T05:51:40.9632982Z  Installing dependencies from lock file (including require-dev) 
2021-06-09T05:51:40.9751962Z  Verifying lock file contents can be installed on current platform. 
2021-06-09T05:51:42.4208308Z Received 0 of 49209747 (0.0%), 0.0 MBs/sec
2021-06-09T05:51:42.6212086Z  Package operations: 186 installs, 0 updates, 0 removals 
2021-06-09T05:51:42.6217458Z   - Downloading  composer/package-versions-deprecated  ( 1.11.99.2 )
2021-06-09T05:51:42.6228500Z   - Downloading  symfony/polyfill-mbstring  ( v1.23.0 )
... a lot of "Downloading ..." dist files ...
2021-06-09T05:51:42.6460638Z   - Syncing  MYORG/SOME-PRIVATE-REPO  ( 3.1.0 ) into cache
2021-06-09T05:51:43.0227542Z Received 49209747 of 49209747 (100.0%), 29.3 MBs/sec
2021-06-09T05:51:43.0228762Z Cache Size: ~47 MB (49209747 B)
2021-06-09T05:51:43.0267378Z [command]/bin/tar --use-compress-program zstd -d -xf /home/runner/work/_temp/1c4b8074-9a05-4165-8e57-9b97c3c0e543/cache.tzst -P -C /home/runner/work/MYREPO/MYREPO
2021-06-09T05:51:43.1632026Z Cache restored successfully
2021-06-09T05:51:43.1746121Z Cache restored from key: linux-php-7.2.34-21+ubuntu18.04.1+deb.sury.org+1-locked-bac6c14ffff580a04a4fea1394e68aa862bb682755fbc9d2277682591500a408-
2021-06-09T05:51:45.7317484Z ##[error]Failed to execute git clone --mirror -- 'ssh://[email protected]/MYORG/MYORG-SOME-PRIVATE-REPO' '/home/runner/.cache/composer/vcs/ssh---git-github.com-MYORG-MYORG-SOME-PRIVATE-REPO/'

Cloning into bare repository '/home/runner/.cache/composer/vcs/ssh---git-github.com-MYORG-MYORG-SOME-PRIVATE-REPO'...
BUG: refs/files-backend.c:2953: initial ref transaction called with existing refs
Aborted (core dumped)

2021-06-09T05:51:45.7333789Z 
2021-06-09T05:51:45.7538921Z  [37;41m                                                                                                                                                                                            [39;49m
2021-06-09T05:51:45.7541852Z  [37;41m  [RuntimeException]                                                                                                                                                                        [39;49m
2021-06-09T05:51:45.7545887Z  [37;41m  Failed to execute git clone --mirror -- 'ssh://[email protected]/MYORG/MYORG-SOME-PRIVATE-REPO' '/home/runner/.cache/composer/vcs/ssh---git-github.com-MYORG-MYORG-SOME-PRIVATE-REPO/'   [39;49m
2021-06-09T05:51:45.7549415Z  [37;41m                                                                                                                                                                                            [39;49m
2021-06-09T05:51:45.7552153Z  [37;41m  Cloning into bare repository '/home/runner/.cache/composer/vcs/ssh---git-github.com-MYORG-MYORG-SOME-PRIVATE-REPO'...                                                                   [39;49m
2021-06-09T05:51:45.7556156Z  [37;41m  BUG: refs/files-backend.c:2953: initial ref transaction called with existing refs                                                                                                         [39;49m
2021-06-09T05:51:45.7558622Z  [37;41m  Aborted (core dumped)                                                                                                                                                                     [39;49m
2021-06-09T05:51:45.7561683Z  [37;41m                                                                                                                                                                                            [39;49m

What strikes me is the way how

2021-06-09T05:51:43.1632026Z Cache restored successfully
2021-06-09T05:51:43.1746121Z Cache restored from key: linux-php-7.2.34-21+ubuntu18.04.1+deb.sury.org+1-locked-bac6c14ffff580a04a4fea1394e68aa862bb682755fbc9d2277682591500a408-

happens just before the error, and how that is interleaved with the actual Composer run.

So, my suspicion is that some async operations go wrong here, so that the cache is restored while Composer is already running. Maybe that does not make much of a difference for dist files, but might be enough to make git stumble when it runs on a partly-restored repo?

I should also add that I have some concurrent workflows that run this action here at about the same time. But to my knowledge, different workflows run in isolated environments. So I would rule out any kind of cross-workflow race conditions.

No errors output when composer.json is invalid

When example pushing the composer.json with a invalid whitespace character the composer install action does not show the error which did happened:

https://github.com/sulu/SuluHeadlessBundle/runs/1887128062?check_suite_focus=true

Bildschirmfoto 2021-02-12 um 13 34 14

Not sure if this is a problem with github actions or the implementation I'm sadly not familiar enough who does handle this.
When running the command itself the correct error is shown:

~/D/S/s/v/sulu/headless-bundle (feature/php-8-compatibility|✔) $ composer update


  [UnexpectedValueException]
  Could not parse version constraint  2.*: Invalid version string " 2.*"

Build failing when composer no longer has accessed to checksum data

image

See https://github.com/orchestral/testbench-core/actions/runs/343623322

Workflow:

name: tests

on:
  push:
  pull_request:
  schedule:
    - cron: '0 0 * * *'

jobs:
  tests:
    runs-on: ${{ matrix.os }}
    continue-on-error: ${{ matrix.experimental }}
    strategy:
      matrix:
        os:
          - "ubuntu-latest"
          - "windows-latest"
        php:
          - "7.2"
          - "7.3"
          - "7.4"
          - "8.0"
        dependencies:
          - "locked"
          - "lowest"
          - "highest"
        experimental:
          - false

    name: PHP${{ matrix.php }} on ${{ matrix.os }} (${{ matrix.dependencies }})

    steps:
      - name: Checkout code
        uses: actions/checkout@v1

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, mysql, mysqli, pdo_mysql, bcmath, intl, fileinfo
          coverage: none

      - name: Install dependencies
        uses: "ramsey/composer-install@v1"
      - name: Execute tests
        run: vendor/bin/phpunit

Add `retries:` input

Many people wrap composer update innick-invision/retry.

It would be nice to add a retries: input with default 0.
Thank you for considering!

Q: When is the cache discarded/replaced ?

I think it would be useful to add some information to the Readme about the elements used in the cache key and when the cache is replaced by a new cache.

It would be helpful to have that information available as it is essential for deciding whether or not to switch to this action or continue to do the caching manually for complex workflows.

Related discussion: WordPress/wordpress-develop#1511 (comment)

Better cache busting when using `dependency-versions: 'highest'`

Better cache busting when using highest dependency versions

Using dependency-versions: 'highest' is the equivalent to running composer update, ensuring the latest versions of these dependencies are always used.

When it comes to cache keys, the key is unaware of when updates are available since the composer.(json|lock) files (hashed and used as part of the cache key) are not always updated to reflect these changes (the benefit of using highest is you don't have to).

Background/problem

If a project goes a long time without updating their composer.(json|lock) files, it's possible that the cache restored could become really outdated This reduces the benefit of the cache since update will need to pull new versions every workflow run.

Proposal/solution

One way to fix this could be to include a date in the cache key when using highest. In WordPress/wordpress-develop, we chose to use the date for the previous Monday to ensure the cache was refreshed at least once a week.

Support `composer-bin` commands like `composer bin [folder] install`

We extensively use https://github.com/bamarni/composer-bin-plugin to manage dev dependencies to avoid conflicts and dependencies hells.

bamarni/composer-bin-plugin requires to use the argument bin before the Composer's argument.

Something like:

  • composer bin [folder] install
  • composer bin [folder] update

Currently it is not possible to use this action in conjunction with bamarni/composer-bin-plugin as it is not possible to prepend bin [folder] to the actual Composer's command (install/update).

What we tested

We tried to directly call the action in the folders where the composer-bin composer.json files reside:

...
            -   name: Install Composer bin PHPunit
                uses: ramsey/composer-install@v2
                with:
                    working-directory: "vendor-bin/phpunit"

            -   name: Run PHPunit
                run: |
                    vendor/bin/simple-phpunit
...

Unfortunately this doesn't work as the executable is not moved to the main vendor/bin folder and so it doesn't exist there.

So, we thought we could change the step to actually call the executable directly from the vendor-bin/[folder]:

...
            -   name: Install Composer bin PHPunit
                uses: ramsey/composer-install@v2
                with:
                    working-directory: "vendor-bin/phpunit"

            -   name: Run PHPunit
                run: |
-                    vendor/bin/simple-phpunit
+                    vendor-bin/phpunit/vendor/bin/simple-phpunit
...

Unfortunately this also doesn't work as not all classes are dumped in the autoload, mainly the ones of the project: bamarni/composer-bin-plugin, in facts, merges all the classes from the autoload key in the root composer.json with the ones found in the various bin subfolders in one autoload file, so it is possible to maintain all the dependencies separate, but anyway using them as if they were all installed in the root composer.json.
Obviously, it also has a mechanism to avoid conflicts (but this mechanism is not related to this issue, so I'm skipping it).

Proposal/solution

I think the besto solution is to directly support bamarni/composer-bin-plugin, allowing to set a key for it with the name of the folder in which is the composer.json file to install.

So, continuing with the previous PHPUnit example and assuming the composer.json file we want to install is in vendor-bin/phpunit/composer.json, then we could configure the action with something like this:

            -   name: Install Composer bin PHPunit
                uses: ramsey/composer-install@v2
                with:
                    bin: "phpunit"

Local run action using act fails, but on the repo it passes

Hi!

I noticed that when I run my actions using act, the composer dependency installation fails

Local setup

[CS/Quality control checks] 🚀  Start image=shivammathur/node:latest
[CS/Quality control checks]   🐳  docker run image=shivammathur/node:latest entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[CS/Quality control checks]   🐳  docker cp src=/Users/denis.zoljom/Projects/Personal/wpthemeReview/. dst=/github/workspace
[CS/Quality control checks] ⭐  Run Checkout
[CS/Quality control checks]   ✅  Success - Checkout
[CS/Quality control checks] ⭐  Run PHP setup
[CS/Quality control checks]   ☁  git clone 'https://github.com/shivammathur/setup-php' # ref=v2
[CS/Quality control checks]   🐳  docker cp src=/Users/denis.zoljom/.cache/act/shivammathur-setup-php@v2 dst=/actions/
| [command]/bin/bash /opt/hostedtoolcache/linux.sh 7.4 /actions/shivammathur-setup-php@v2/dist
|
| ==> Setup PHP
| ✓ PHP Switched to PHP 7.4.13
|
| ==> Setup Tools
| ✓ composer Added composer 2.0.8
|
| ==> Setup Coverage
| ✓ none Disabled Xdebug and PCOV
|
| ==> Support this project
| ✓ setup-php https://setup-php.com/support
[CS/Quality control checks]   ✅  Success - PHP setup
[CS/Quality control checks] ⭐  Run Set the required PHPCS and WPCS versions
| ./composer.json has been updated
[CS/Quality control checks]   ✅  Success - Set the required PHPCS and WPCS versions
[CS/Quality control checks] ⭐  Run Install Composer dependencies
[CS/Quality control checks]   ☁  git clone 'https://github.com/ramsey/composer-install' # ref=v1
[CS/Quality control checks]   🐳  docker cp src=/Users/denis.zoljom/.cache/act/ramsey-composer-install@v1 dst=/actions/
| Composer cache directory found at /github/home/.composer/cache
| Using locked versions of dependencies
[CS/Quality control checks]   💬  ::debug::followSymbolicLinks 'false'
[CS/Quality control checks]   💬  ::debug::followSymbolicLinks 'false'
[CS/Quality control checks]   💬  ::debug::implicitDescendants 'true'
[CS/Quality control checks]   💬  ::debug::omitBrokenSymbolicLinks 'true'
[CS/Quality control checks]   💬  ::debug::Search path '/github/workspace/composer.json'
[CS/Quality control checks]   💬  ::debug::Search path '/github/workspace/composer.lock'
| PHP version is 7.4.13
| Cache primary key is php-7.4.13-locked-974c02999424f7583279b267a29d3e00a005175094444241082724389aa09653-
| Cache restore keys are: php-7.4.13-locked-974c02999424f7583279b267a29d3e00a005175094444241082724389aa09653-, php-7.4.13-locked-
[CS/Quality control checks]   ❓  ::save-state name=CACHE_KEY::php-7.4.13-locked-974c02999424f7583279b267a29d3e00a005175094444241082724389aa09653-
[CS/Quality control checks]   💬  ::debug::Resolved Keys:
[CS/Quality control checks]   💬  ::debug::["php-7.4.13-locked-974c02999424f7583279b267a29d3e00a005175094444241082724389aa09653-","php-7.4.13-locked-974c02999424f7583279b267a29d3e00a005175094444241082724389aa09653-","php-7.4.13-locked-"]
[CS/Quality control checks]   💬  ::debug::Checking zstd --version
| [command]/usr/local/bin/composer install --no-interaction --no-progress --ansi
[CS/Quality control checks]   💬  ::debug::Unable to locate executable file: zstd. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.
[CS/Quality control checks]   💬  ::debug::
[CS/Quality control checks]   💬  ::debug::getCacheEntry - Attempt 1 of 2 failed with error: Cache Service Url not found, unable to restore cache.
[CS/Quality control checks]   💬  ::debug::getCacheEntry - Attempt 2 of 2 failed with error: Cache Service Url not found, unable to restore cache.
| [warning]getCacheEntry failed: Cache Service Url not found, unable to restore cache.
[CS/Quality control checks]   ⚙  ::set-output:: cache-hit=false
| No lock file found. Updating dependencies instead of installing from lock file. Use composer update over composer install if you do not have a lock file.
| Loading composer repositories with package information
| Updating dependencies
| Lock file operations: 36 installs, 0 updates, 0 removals
|   - Locking dealerdirect/phpcodesniffer-composer-installer (v0.7.1)
|   - Locking doctrine/instantiator (1.4.0)
|   - Locking myclabs/deep-copy (1.10.2)
|   - Locking phar-io/manifest (1.0.3)
|   - Locking phar-io/version (2.0.1)
|   - Locking phpcompatibility/php-compatibility (9.3.5)
|   - Locking phpcompatibility/phpcompatibility-paragonie (1.3.0)
|   - Locking phpcompatibility/phpcompatibility-wp (2.1.0)
|   - Locking phpcsstandards/phpcsdevtools (1.0.1)
|   - Locking phpdocumentor/reflection-common (2.2.0)
|   - Locking phpdocumentor/reflection-docblock (5.2.2)
|   - Locking phpdocumentor/type-resolver (1.4.0)
|   - Locking phpspec/prophecy (1.12.2)
|   - Locking phpunit/php-code-coverage (6.1.4)
|   - Locking phpunit/php-file-iterator (2.0.3)
|   - Locking phpunit/php-text-template (1.2.1)
|   - Locking phpunit/php-timer (2.1.3)
|   - Locking phpunit/php-token-stream (3.1.2)
|   - Locking phpunit/phpunit (7.5.20)
|   - Locking roave/security-advisories (dev-master d596191)
|   - Locking sebastian/code-unit-reverse-lookup (1.0.2)
|   - Locking sebastian/comparator (3.0.3)
|   - Locking sebastian/diff (3.0.3)
|   - Locking sebastian/environment (4.2.4)
|   - Locking sebastian/exporter (3.1.3)
|   - Locking sebastian/global-state (2.0.0)
|   - Locking sebastian/object-enumerator (3.0.4)
|   - Locking sebastian/object-reflector (1.1.2)
|   - Locking sebastian/recursion-context (3.0.1)
|   - Locking sebastian/resource-operations (2.0.2)
|   - Locking sebastian/version (2.0.1)
|   - Locking squizlabs/php_codesniffer (dev-master 9bcb29c)
|   - Locking symfony/polyfill-ctype (v1.20.0)
|   - Locking theseer/tokenizer (1.2.0)
|   - Locking webmozart/assert (1.9.1)
|   - Locking wp-coding-standards/wpcs (dev-master 7da1894)
| Writing lock file
| Installing dependencies from lock file (including require-dev)
| Package operations: 36 installs, 0 updates, 0 removals
|   - Downloading dealerdirect/phpcodesniffer-composer-installer (v0.7.1)
|   - Downloading phpcompatibility/php-compatibility (9.3.5)
|   - Downloading phpcompatibility/phpcompatibility-paragonie (1.3.0)
|   - Downloading phpcompatibility/phpcompatibility-wp (2.1.0)
|   - Downloading phpcsstandards/phpcsdevtools (1.0.1)
|   - Downloading symfony/polyfill-ctype (v1.20.0)
|   - Downloading webmozart/assert (1.9.1)
|   - Downloading phpdocumentor/reflection-common (2.2.0)
|   - Downloading phpdocumentor/type-resolver (1.4.0)
|   - Downloading phpdocumentor/reflection-docblock (5.2.2)
|   - Downloading phpunit/php-token-stream (3.1.2)
|   - Downloading sebastian/version (2.0.1)
|   - Downloading sebastian/resource-operations (2.0.2)
|   - Downloading sebastian/recursion-context (3.0.1)
|   - Downloading sebastian/object-reflector (1.1.2)
|   - Downloading sebastian/object-enumerator (3.0.4)
|   - Downloading sebastian/global-state (2.0.0)
|   - Downloading sebastian/exporter (3.1.3)
|   - Downloading sebastian/environment (4.2.4)
|   - Downloading sebastian/diff (3.0.3)
|   - Downloading sebastian/comparator (3.0.3)
|   - Downloading phpunit/php-timer (2.1.3)
|   - Downloading phpunit/php-text-template (1.2.1)
|   - Downloading phpunit/php-file-iterator (2.0.3)
|   - Downloading theseer/tokenizer (1.2.0)
|   - Downloading sebastian/code-unit-reverse-lookup (1.0.2)
|   - Downloading phpunit/php-code-coverage (6.1.4)
|   - Downloading doctrine/instantiator (1.4.0)
|   - Downloading phpspec/prophecy (1.12.2)
|   - Downloading phar-io/version (2.0.1)
|   - Downloading phar-io/manifest (1.0.3)
|   - Downloading myclabs/deep-copy (1.10.2)
|   - Downloading phpunit/phpunit (7.5.20)
|   - Installing squizlabs/php_codesniffer (dev-master 9bcb29c): Cloning 9bcb29cce8
|     Install of squizlabs/php_codesniffer failed
| ::error ::Failed to clone https://github.com/squizlabs/PHP_CodeSniffer.git, git was not found, check that it is installed and in your PATH env.%0A%0Ash: 1: git: not found%0A
|
|
|   [RuntimeException]
|   Failed to clone https://github.com/squizlabs/PHP_CodeSniffer.git, git was not found, check that it is installed and in your PATH env.
|
|   sh: 1: git: not found
|
|
| install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-scripts] [--no-progress] [--no-install] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] []...
|
[CS/Quality control checks]   ❗  ::error::The process '/usr/local/bin/composer' failed with exit code 1
[CS/Quality control checks]   ❌  Failure - Install Composer dependencies
Error: exit with `FAILURE`: 1

This is odd since the setup is passing on the actual repo: https://github.com/WPTT/WPThemeReview/pull/261/checks?check_run_id=1584111259

Any ideas what could be the issue?

This is the workflow file

name: CS

on:
  # Run on PRs and pushes, only on significant changes.
  push:
    paths-ignore:
      - '**.md'
  pull_request:
    paths-ignore:
      - '**.md'

env:
  XMLLINT_INDENT: '	'

jobs:
    qa_checks:
        name: Quality control checks
        runs-on: ubuntu-latest

        steps:
            # Checkout repository
            - name: Checkout
              uses: actions/checkout@v2

            # Setup PHP versions, run checks
            - name: PHP setup
              uses: shivammathur/setup-php@v2
              with:
                php-version: '7.4'
                coverage: none
              env:
                COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

            - name: Set the required PHPCS and WPCS versions
              run: composer require squizlabs/php_codesniffer:"dev-master" wp-coding-standards/wpcs:"dev-master" --no-update --no-scripts

            # Install dependencies and handle caching in one go.
            # @link https://github.com/marketplace/actions/install-composer-dependencies
            - name: Install Composer dependencies
              uses: "ramsey/composer-install@v1"

            - name: Install xmllint
              run: sudo apt-get install --no-install-recommends -y libxml2-utils

            # Show XML violations inline in the file diff.
            # @link https://github.com/marketplace/actions/xmllint-problem-matcher
            - uses: korelstar/xmllint-problem-matcher@v1

            - name: Validate ruleset against schema
              run: xmllint --noout --schema ./vendor/squizlabs/php_codesniffer/phpcs.xsd ./*/ruleset.xml

            - name: Check the code-style consistency of the xml files.
              run: diff -B --tabsize=4 ./WPThemeReview/ruleset.xml <(xmllint --format "./WPThemeReview/ruleset.xml")

            - name: Lint the PHP files against parse errors
              run: if find . -path ./vendor -prune -o -name "*.php" -exec php -l {} \; | grep "^[Parse error|Fatal error]"; then exit 1; fi

            - name: Validate the composer.json file.
              run: composer validate --no-check-all --strict

            - name: Check the code style of the WPThemeReview codebase
              run: composer check-cs

            - name: Check feature completeness of the available sniffs
              run: composer check-complete

I tried deleting all my docker images, doing docker system prune, nothing helped.

I am running this on MacOS 11.1 (Big Sur)
Docker version: Docker version 20.10.0, build 7287ab3 and Docker desktop 3.0.1

Add OS as part of cache key

When generating the cache key add the OS so that when a user want's to install the dependencies on different OSs the caches are distinct from another.

failed to open stream

Hello, good morning, I created an yml file like this using the examples on the main page.

on:
  push:
    paths-ignore:
      - 'README.md'
      - 'public/**'
      - 'laradock/**'
name: 🚀 Deploy website on push (Master)
jobs:
  web-deploy:
    name: 🎉 Deploy
    runs-on: ubuntu-latest
    steps:
      - uses: "actions/checkout@v3"
      - uses: "shivammathur/setup-php@v2"
        with:
          php-version: "latest"
      - uses: "ramsey/composer-install@v2"
          
      - name: Config ENV file
        run: mv .env.example .env

      - name: php artisan storage:link
        run: php artisan storage:link

      - name: php artisan optimize:clear
        run: php artisan optimize:clear

      - name: 📂 Sync files
        uses: SamKirkland/[email protected]
        with:
          server: ftp.example.ir
          username: example
          password: ${{ secrets.ftp_password }}
          server-dir: /dev.otoolbox.ir/

This action of mine runs correctly, but when I go to the host, an error file is created that shows the error related to the compressor. I manually transferred this folder from local to host and found that it works properly when I add local contents, but it gets an error when dependencies are created automatically.
Thanks to me, help me fix this problem.

Compatibility with Composer 1 broken due to validate command

Description

Composer 1.x does not support the --no-check-version and will throw the below error causing the action to error out:

  [Symfony\Component\Console\Exception\RuntimeException]
  The "--no-check-version" option does not exist.

validate [--no-check-all] [--no-check-lock] [--no-check-publish] [-A|--with-dependencies] [--strict] [--] [<file>]

Steps to reproduce

  1. Using Composer 1.x, try to run a composer install via the action and see it fail.
  2. Run `composer validate --strict: it will indicate the composer.json is valid

Example code to reproduce the issue: jrfnl/composer-install-action-bug@98a82bd

Action run showing the bug: https://github.com/jrfnl/composer-install-action-bug/runs/4633075161?check_suite_focus=true

Expected behavior

That the dependencies would be installed without errors when using Composer 1.x.

Environment details

  • version of this package: 2.0.2
  • PHP version: not relevant
  • OS: not relevant

Action randomly fail on windows

Action: https://github.com/LastDragon-ru/lara-asp/blob/f990092be38daceb9e7323ccd7683c8d92c974a3/.github/workflows/phpunit.yml

image
image

Run ramsey/composer-install@v1
  with:
    dependency-versions: lowest
Composer cache directory found at C:/Users/runneradmin/AppData/Local/Composer
Using lowest versions of dependencies
PHP version is 8.0.1
Cache primary key is php-8.0.1-lowest-d4af0aef979962d8b86c4245098c594c33b9a95fe0dcd010d691cccf5d6c37b8-
Cache restore keys are: php-8.0.1-lowest-d4af0aef979962d8b86c4245098c594c33b9a95fe0dcd010d691cccf5d6c37b8-, php-8.0.1-lowest-
C:\windows\system32\cmd.exe /D /S /C "c:\tools\php\composer.bat update --prefer-lowest --no-interaction --no-progress --ansi"
Loading composer repositories with package information
Received 9916529 of 9916529 (100.0%), 54.0 MBs/sec
Cache Size: ~9 MB (9916529 B)
C:\windows\System32\tar.exe -z -xf D:/a/_temp/42b8fabb-41d9-442b-a36d-352b47888967/cache.tgz -P -C D:/a/lara-asp-eloquent/lara-asp-eloquent
Error: file_get_contents(C:/Users/runneradmin/AppData/Local/Composer/repo/https---repo.packagist.org/provider-symfony~console.json): Failed to open stream: Resource temporarily unavailable

                                                                                                                       
  [ErrorException]                                                                                                     
  file_get_contents(C:/Users/runneradmin/AppData/Local/Composer/repo/https---repo.packagist.org/provider-symfony~cons  
  ole.json): Failed to open stream: Resource temporarily unavailable                                                   
                                                                                                                       

update [--with WITH] [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-install] [--no-autoloader] [--no-scripts] [--no-suggest] [--no-progress] [-w|--with-dependencies] [-W|--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>]...

Error: The process 'c:\tools\php\composer.bat' failed with exit code 1
Cache restored from key: php-8.0.1-lowest-d4af0aef979962d8b86c4245098c594c33b9a95fe0dcd010d691cccf5d6c37b8-

Cannot find composer.json

Description

We are using this in github workflows with mono repo. Composer install can not find composer.json in sub-directories. Cache is empty.

Steps to reproduce

- uses: ramsey/[email protected]
     with:
        working-directory: something
        composer-options: --prefer-dist

Expected behavior

Should find composer.json and also create cache.

Screenshots or output

[RuntimeException]
File "./composer.json" cannot be found in the current directory

Environment details

  • mono repo
  • version of this package: 2.1.0
  • PHP version: 8.1

Additional context

Custom cache keys does not solve this problem.

Imply --ansi

The readme mentions

ramsey/composer-install always passes the --no-interaction and --no-progress options to the composer command.

Since GithubAction also supports color coded logs, it would be great if --ansi would also be a default

`set-output` function is deprecated

Description

GitHub in their wisdom has deprecated the use of set-output (and save-state). As set-output is used in every script in this action runner, the logs of any workflow run using it are now showing lots of warnings.

Refs:

Expected behavior

No warnings.

Screenshots or output

image

Environment details

Not relevant

Additional context

I've got the principle for a fix ready, just running into issues with the tests as expect doesn't show the new output, so I'm not all that sure what the updated output expectations should be.

Check fails both locally with act and on the action run on GH

Hi!

My action looks like this:

name: Continuous integration checks

on:
  # Run on PRs and pushes, only on significant changes.
  push:
    paths-ignore:
      - '**.md'
  pull_request:
    paths-ignore:
      - '**.md'

jobs:
  phpcs:
    name: PHPCS check on PHP ${{ matrix.php }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        php: [7.4]

    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: PHP setup
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          coverage: none
          tools: composer:v2

      - name: Install Composer dependencies
        uses: ramsey/composer-install@v1

      - name: Check coding standards using PHPCS
        run: composer standards:check -- --runtime-set testVersion ${{ matrix.php }}-

But when I run it I get

[Continuous integration checks/PHPCS check on PHP 7.4] 🧪  Matrix: map[php:7.4]
[Continuous integration checks/PHPCS check on PHP 7.4] 🚀  Start image=shivammathur/node:latest
[Continuous integration checks/PHPCS check on PHP 7.4]   🐳  docker run image=shivammathur/node:latest entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[Continuous integration checks/PHPCS check on PHP 7.4]   🐳  docker cp src=/Users/denis.zoljom/Projects/Infinum/wordpress-ci-cd-test/. dst=/github/workspace
[Continuous integration checks/PHPCS check on PHP 7.4] ⭐  Run Checkout
[Continuous integration checks/PHPCS check on PHP 7.4]   ✅  Success - Checkout
[Continuous integration checks/PHPCS check on PHP 7.4] ⭐  Run PHP setup
[Continuous integration checks/PHPCS check on PHP 7.4]   ☁  git clone 'https://github.com/shivammathur/setup-php' # ref=v2
[Continuous integration checks/PHPCS check on PHP 7.4]   🐳  docker cp src=/Users/denis.zoljom/.cache/act/shivammathur-setup-php@v2 dst=/actions/
| [command]/bin/bash /opt/hostedtoolcache/linux.sh 7.4 /actions/shivammathur-setup-php@v2/dist
|
| ==> Setup PHP
| ✓ PHP Switched to PHP 7.4.13
|
| ==> Setup Tools
| ✓ composer Added composer 1.10.20
| ✓ deployer Added deployer 6.8.0
| ✓ wp-cli Added wp-cli
|
| ==> Setup Coverage
| ✓ none Disabled Xdebug and PCOV
|
| ==> Support this project
| ✓ setup-php https://setup-php.com/support
[Continuous integration checks/PHPCS check on PHP 7.4]   ✅  Success - PHP setup
[Continuous integration checks/PHPCS check on PHP 7.4] ⭐  Run Install Composer dependencies
[Continuous integration checks/PHPCS check on PHP 7.4]   ☁  git clone 'https://github.com/ramsey/composer-install' # ref=v1
[Continuous integration checks/PHPCS check on PHP 7.4]   🐳  docker cp src=/Users/denis.zoljom/.cache/act/ramsey-composer-install@v1 dst=/actions/
[Continuous integration checks/PHPCS check on PHP 7.4]   ❗  ::error::The process '/usr/local/bin/composer' failed with exit code 1
[Continuous integration checks/PHPCS check on PHP 7.4]   ❌  Failure - Install Composer dependencies
Error: exit with `FAILURE`: 1

if I run the action with -v flag I get

[Continuous integration checks/PHPCS check on PHP 7.4] ⭐  Run Install Composer dependencies
[Continuous integration checks/PHPCS check on PHP 7.4]   ☁  git clone 'https://github.com/ramsey/composer-install' # ref=v1
[Continuous integration checks/PHPCS check on PHP 7.4]   cloning https://github.com/ramsey/composer-install to /Users/denis.zoljom/.cache/act/ramsey-composer-install@v1
[Continuous integration checks/PHPCS check on PHP 7.4] Provided ref is not a sha. Checking out branch before pulling changes
[Continuous integration checks/PHPCS check on PHP 7.4] Cloned https://github.com/ramsey/composer-install to /Users/denis.zoljom/.cache/act/ramsey-composer-install@v1
[Continuous integration checks/PHPCS check on PHP 7.4] Checked out v1
DEBU[0022] Read action &{Install Composer Dependencies Ben Ramsey Installs and caches Composer dependencies, accepting arguments to configure how and what to install. map[composer-options:{Additional options to pass to Composer (e.g. --ignore-platform-reqs). false } dependency-versions:{The version of dependencies to prefer (lowest, highest, or locked). true locked}] map[] {node12 map[] dist/main/index.js  [] []} {purple download}} from '/Users/denis.zoljom/.cache/act/ramsey-composer-install@v1/action.yml'
DEBU[0022] About to run action &{Install Composer Dependencies Ben Ramsey Installs and caches Composer dependencies, accepting arguments to configure how and what to install. map[composer-options:{Additional options to pass to Composer (e.g. --ignore-platform-reqs). false } dependency-versions:{The version of dependencies to prefer (lowest, highest, or locked). true locked}] map[] {node12 map[] dist/main/index.js  [] []} {purple download}}
DEBU[0022] type=3 actionDir=/Users/denis.zoljom/.cache/act/ramsey-composer-install@v1 actionPath= Workdir=/Users/denis.zoljom/Projects/Infinum/wordpress-ci-cd-test ActionCacheDir=/Users/denis.zoljom/.cache/act actionName=ramsey-composer-install@v1 containerActionDir=/actions
DEBU[0022] Removing /Users/denis.zoljom/.cache/act/ramsey-composer-install@v1/.gitignore before docker cp
[Continuous integration checks/PHPCS check on PHP 7.4]   🐳  docker cp src=/Users/denis.zoljom/.cache/act/ramsey-composer-install@v1 dst=/actions/
[Continuous integration checks/PHPCS check on PHP 7.4] Exec command '[mkdir -p /actions/]'
DEBU[0022] Writing tarball /var/folders/mf/jxbsh3dd6zb43qy2mw1cgq1r0000gn/T/act008565115 from /Users/denis.zoljom/.cache/act/ramsey-composer-install@v1
DEBU[0022] Stripping prefix:/Users/denis.zoljom/.cache/act/ src:/Users/denis.zoljom/.cache/act/ramsey-composer-install@v1
[Continuous integration checks/PHPCS check on PHP 7.4] Extracting content from '/var/folders/mf/jxbsh3dd6zb43qy2mw1cgq1r0000gn/T/act008565115' to '/actions/'
DEBU[0022] executing remote job container: [node /actions/ramsey-composer-install@v1/dist/main/index.js]
[Continuous integration checks/PHPCS check on PHP 7.4] Exec command '[node /actions/ramsey-composer-install@v1/dist/main/index.js]'
[Continuous integration checks/PHPCS check on PHP 7.4]   ❗  ::error::The process '/usr/local/bin/composer' failed with exit code 1
[Continuous integration checks/PHPCS check on PHP 7.4]   ❌  Failure - Install Composer dependencies
DEBU[0023] exit with `FAILURE`: 1
DEBU[0023] exit with `FAILURE`: 1
Error: exit with `FAILURE`: 1

Not sure what seems to be the problem 🤷🏼‍♂️

Yaml is invalid?

Description

Running ramsey/composer-install@v2 gives a weird error:

Error: The template is not valid. ramsey/composer-install/v2/action.yml (Line: 61, Col: 12): An error occurred trying to start process

Steps to reproduce

I'm not sure yet, only just started happening - everything was working fine before

Expected behavior

It works as it did before?

Environment details

  • version of this package: v2 tag, so latest v2
  • PHP version: 7.4
  • OS: Ubuntu 20.04 (GitHub Hosted Runner, ubuntu-latest)

Additional context

It was working fine before, we've made no workflow changes.

Ability to swap out actions/cache for the faster alternative buildjet/cache

Ability to swap out actions/cache for the faster alternative buildjet/cache

Background/problem

GitHub Actions cache has a number of issues surrounding performance when used on self-hosted runners. GitHub has failed to address this on numerous occassions so BuildJet created their own free cache alternative with double the amount of storage and much faster performance. It would be nice if we could use this in ramsey/composer-install, providing an option to specify which cache we wanted to use.

Proposal/solution

I propose that we add a new option which specifies which cache we would like to use and have this shared action then use the cache specified. We can leave the default to GitHub to keep backward compatibility.

Alternatives

Haven't considered any alternatives.

Additional context

https://buildjet.com/for-github-actions/blog/launch-buildjet-cache

Cache Issue when conflicting dependencies

I have added new conflicts to our dependencies. Now composer install fails with a strange error that it can not downgrade something:

https://github.com/sulu/skeleton/runs/2230689404

It looks for me like that the action does restore an old composer.lock or old vendor directory and so it does not allow to downgrade something.

Could also not fix it by adding composer-flag which was outputted:

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

as flags as it seems some command is run where this is not possible. I think there should be no cache for vendor or composer.lock file instead just the global composer cache directory should be cached. Else downgrade like this don't work. Maybe my intention is false just how it looks for my what happens.

Action debug information showing in workflow run summary

Description

It looks like a notice which is intended as information to be included in the action output, is leaking through to the workflow summary.

This makes the action very noisy and makes it more difficult to see the actual failure notifications which are supposed to display there.

If this behaviour is intentional (I hope not), then I'd like to note that the notice as-is, is not very useful as it doesn't link the notice to a particular job run, so the viewer has no clue to which job the notice relates.

Steps to reproduce

  1. Use v2 of the action in a workflow and look at the workflow summary

Expected behavior

Notices not to appear in the workflow summary.

Screenshots or output

image

Environment details

  • version of this package: 2.0.2
  • PHP version: not relevant
  • OS: not relevant

Customising the cache key

Please add a way that we can customise the cache key. We are getting issues with Dependabot PRs that when dependabot rebases, this action fails because its using a cache from the previous run. It would be nice if we could use our own cache key.

Failed to extracting archive when use parallel jobs with ramsey/composer-install@v1

name: Run tests and deploy

on:
  workflow_dispatch:
  push:
    paths:
      - '**.php'
      - '**.js'
      - '**.json'
      - '**.xml'
      - 'composer.*'
      - '.github/workflows/main.yml'

jobs:

  test_php:
    name: Run PHP tests
    runs-on: ubuntu-18.04

    steps:
      - uses: actions/checkout@v2
        with:
          ref: ${{ github.head_ref }}

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: 8.0
          extensions: bcmath, curl, dom, filter, gd, hash, intl, json, libxml, mbstring, openssl, pdo_mysql, pdo, redis, simpleXML
          coverage: none

      - name: Install composer dependencies
        uses: ramsey/composer-install@v1
        with:
          composer-options: "--prefer-dist --no-scripts"


  check_php_syntax:
    name: Check PHP syntax
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        with:
          ref: ${{ github.head_ref }}

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: 8.0
          extensions: bcmath, curl, dom, filter, gd, hash, intl, json, libxml, mbstring, openssl, pdo_mysql, pdo, redis, simpleXML
          tools: cs2pr
          coverage: none

      - name: Install composer dependencies
        uses: ramsey/composer-install@v1
        with:
          composer-options: "--prefer-dist --no-scripts"
Failed to extract square1/nova-metrics: (9) '/usr/bin/unzip' -qq '/home/runner/work/REPO-NAME/REPO-NAME/vendor/composer/tmp-887e5e92dba4429f8f1bb7ee187d3e61' -d '/home/runner/work/REPO-NAME/REPO-NAME/vendor/composer/344f5f96'

[/home/runner/work/REPO-NAME/REPO-NAME/vendor/composer/tmp-887e5e92dba4429f8f1bb7ee187d3e61]
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /home/runner/work/REPO-NAME/REPO-NAME/vendor/composer/tmp-887e5e92dba4429f8f1bb7ee187d3e61 or
        /home/runner/work/REPO-NAME/REPO-NAME/vendor/composer/tmp-887e5e92dba4429f8f1bb7ee187d3e61.zip, and cannot find /home/runner/work/REPO-NAME/REPO-NAME/vendor/composer/tmp-887e5e92dba4429f8f1bb7ee187d3e61.ZIP, period.

    The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)
    Unzip with unzip command failed, falling back to ZipArchive class
    Install of square1/nova-metrics failed
Error: '/home/runner/work/REPO-NAME/REPO-NAME/vendor/composer/tmp-887e5e92dba4429f8f1bb7ee187d3e61' is not a zip archive.

Composer config for http-basic

I am trying to install Laravel Nova in my CI workflow. Nova requires authentication. The easiest way which I did in the past when I manually installed Composer (without this action) was to simply run:

composer config http-basic.nova.laravel.com ${NOVA_USERNAME} ${NOVA_PASSWORD}

Can this be done with this action? Looks like maybe not at least out of the box.

Heads-up: upcoming (helpful) change in setupPHP

This is just a heads-up and for your information.

Basic premise:

Composer commands when used in CI, should always use the --no-interaction flag, which this action already (correctly) takes care of.

The heads-up:

After a recent discussion about this in the setup-php repo, a change has been made in setup-php to set the COMPOSER_NO_INTERACTION=1 flag (commit shivammathur/setup-php@e7e1eee), which will have the same effect for all composer commands run in a job.

This change is expected to be included in the next release of setup-php.

Impact on this action

I expect that this will/should probably not have any impact on this plugin, as users of this action may not necessarily be using the latest version of setup-php or may possibly not even be using setup-php.

@ramsey Either way, I figured it may be useful for you to know about this change in advance. Please feel free to close this issue if you agree that this upstream change will not impact this action.

Add `--no-audit` to default options used ?

Prevent audits breaking builds

Composer 2.4.0 introduced a new "Audit" feature, which will run automatically on any composer update, require, remove and create-project.

This audit feature may break builds when security vulnerabilities are found.

The audit feature can be disabled using the --no-audit option - or as of Composer 2.4.1, using the new COMPOSER_NO_AUDIT env variable.

As composer-install already automatically applies typical options like --no-interaction, I was wondering if the --no-audit option should be added to that list of options which are automatically applied.

What do you think ?

Refs:

Alternatives

Rely on people adding the --no-audit flag manually to the composer-options in all their CI scripts.

Action erroring out on with incorrect invalid `composer.json` report

Description

Okay, so this is a "fun" one 😕. If I make a simple --no-update change ahead of running the composer-install action, it will error out saying the composer.json file is invalid, while in actual fact the composer.json file is perfectly valid, but the (committed) lock file is out of date (which may be completely intentional).

Making a --no-update change ahead of running the composer-install action is a common way to ensure the caching done via composer-install is used optimally, while still being able to make select changes depending on the PHP version the workflow is being run on.

Steps to reproduce

  1. On a repo with a committed composer.lock file
  2. Run a composer .... --no-update command or other Composer command which won't run update, like composer config --unset platform.php
  3. Try to run a composer update via the action and see it fail.
  4. Run composer validate --strict: it will indicate the composer.json is valid, but the lock file is out of date.
    ./composer.json is valid but your composer.lock has some errors
    # Lock file errors
    - The lock file is not up to date with the latest changes in composer.json, it is recommended that you run `composer update` or `composer update <package name>`.
    

Example code to reproduce the issue: https://github.com/jrfnl/composer-install-action-bug

Action run showing the bug: https://github.com/jrfnl/composer-install-action-bug/actions/runs/1620893221

Expected behavior

That the composer-install action doesn't error out on the lock file being out of date as this may be wholly intentional, especially if a (selective) composer update is being run via the composer-install action.

Environment details

  • version of this package: 2.0.2
  • PHP version: not relevant
  • OS: not relevant

Use of `defaults.run.working-directory`

First things first, thanks a lot for this GitHub Actions workflow ! 👍

I see that there is the composer-options that allow to specify the working directory with --working-dir=foo if the composer.json file is in the foo sub-directory.

I'm using the defaults.run.working-directory in my workflow:

defaults:
  run:
    working-directory: foo/

Is there a way to make ramsey/composer-install use that defaults.run.working-directory if it is specified ?

Thanks!

locked version vs. missing lock file

My feature title

Would you merge a PR that adds an argument to fail the job when dependencies: locked but the lock file is missing?

Background/problem

I'd like to see that problem in form of a ❌

# If there is no composer.lock file, then use the `update` command.
if [ -z "${composer_lock}" ]; then
composer_command="update"
fi

"Could not authenticate against github.com"

Description

I'm getting intermittent Could not authenticate against github.com errors in my CI, and I can't pinpoint the problem.

Steps to reproduce

See https://github.com/facile-it/paraunit/actions/runs/4105982330/jobs/7083607877
From this PR: facile-it/paraunit#183

Expected behavior

No issues

Screenshots or output

https://github.com/facile-it/paraunit/actions/runs/4105982330/jobs/7083607877#step:5:95

Environment details

It seems to happen for Tests CI jobs of that project, which are defined like this: https://github.com/facile-it/paraunit/blob/1c5414f0d9b4c67bafe0e05f40dcf9cf83ec20d1/.github/workflows/tests.yaml#L10

Additional context

The linked PR is very removed from the main branch (new major in the works). But the CI definition is very close, I just dropped older PHP versions:

I just rerun on the main branch and it works: https://github.com/facile-it/paraunit/actions/runs/4106204844 (failure on Windows is unrelated)

Is it possible that the failure is due to the usage of some additional repositories? I need them to pull some PRs as a dependency patch: https://github.com/facile-it/paraunit/blob/c6a6dc03c48b682ef7060ca218538e2c689edf44/composer.json#L58-L67

CI `run` job only tests with lock files

👋🏻 Just one more thing I was wondering about when looking at the CI workflow - while the matrix is very extensive, it only tests situations with a lock file in place.

working-directory:
- "tests/fixtures/with-lock-file"
- ""

Both the project root as well as the tests/fixtures/with-lock-file working directory contain a composer.lock file.

Should tests/fixtures/with-lock-file be replaced with tests/fixtures/no-lock-file ?
Or maybe tests/fixtures/no-lock-file and tests/fixtures/out-of-sync-lock should both be added to the matrix ?

Failure to restore cache causes the GitHub Action step to run indefinitely

Hey @ramsey,

Thank you for creating this tool, it has been very helpful.

I wanted to report finding this GitHub Action running for 3+ hours and had to manually cancel it.

Description

It had the following warning:

Warning

Failed to restore cache: The operation cannot be completed in timeout.
Cache not found for input keys: Linux-php-8.1.20-composer-locked-b619f299fb03a570a4a0af7f304aa547b70bbfdcd115619c20a806660a0c2e09, Linux-php-8.1.20-composer-locked-

Then it continued to run for 3+ hours (not sure doing what) until manually canceled.

Steps to reproduce

I have a reusable workflow defined in ghostwriter/compliance

https://github.com/ghostwriter/compliance/#/.github/workflows/automation.yml#L60-L63

That workflow is used in ghostwriter/psalm-plugin-tester
https://github.com/ghostwriter/psalm-plugin-tester/actions/runs/5432766284/workflow

It generated these jobs

https://github.com/ghostwriter/psalm-plugin-tester/actions/runs/5432766284/jobs/9880024230

Expected behavior

Continue to the next step or fail gracefully when it fails to restore the cache.

Screenshots or output

image

https://github.com/ghostwriter/psalm-plugin-tester/actions/runs/5432766284/jobs/9880024230

Click to view Raw Logs
2023-07-01T19:43:18.1919234Z Requested labels: ubuntu-latest
2023-07-01T19:43:18.1919467Z Job defined at: ghostwriter/compliance/.github/workflows/automation.yml@refs/heads/v1
2023-07-01T19:43:18.1919645Z Reusable workflow chain:
2023-07-01T19:43:18.1919746Z ghostwriter/psalm-plugin-tester/.github/workflows/compliance.yml@refs/heads/main (a608ac19d07733d8ef207a8bd34bb45adc7cd93e)
2023-07-01T19:43:18.1919840Z -> ghostwriter/compliance/.github/workflows/automation.yml@refs/heads/v1 (3bf14b28b941722c423f8171861d927f41466e4b)
2023-07-01T19:43:18.1919920Z Waiting for a runner to pick up this job...
2023-07-01T19:43:19.2499773Z Job is waiting for a hosted runner to come online.
2023-07-01T19:43:21.0940986Z Job is about to start running on the hosted runner: GitHub Actions 5 (hosted)
2023-07-01T19:43:23.7566335Z Current runner version: '2.305.0'
2023-07-01T19:43:23.7595345Z ##[group]Operating System
2023-07-01T19:43:23.7595848Z Ubuntu
2023-07-01T19:43:23.7596147Z 22.04.2
2023-07-01T19:43:23.7596495Z LTS
2023-07-01T19:43:23.7596754Z ##[endgroup]
2023-07-01T19:43:23.7597102Z ##[group]Runner Image
2023-07-01T19:43:23.7597482Z Image: ubuntu-22.04
2023-07-01T19:43:23.7597778Z Version: 20230625.1.0
2023-07-01T19:43:23.7598346Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20230625.1.0/images/linux/Ubuntu2204-Readme.md
2023-07-01T19:43:23.7599046Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20230625.1.0
2023-07-01T19:43:23.7599464Z ##[endgroup]
2023-07-01T19:43:23.7599819Z ##[group]Runner Image Provisioner
2023-07-01T19:43:23.7600164Z 2.0.238.1
2023-07-01T19:43:23.7600444Z ##[endgroup]
2023-07-01T19:43:23.7601154Z ##[group]GITHUB_TOKEN Permissions
2023-07-01T19:43:23.7601691Z Contents: read
2023-07-01T19:43:23.7602203Z Metadata: read
2023-07-01T19:43:23.7602642Z Packages: read
2023-07-01T19:43:23.7602970Z ##[endgroup]
2023-07-01T19:43:23.7606591Z Secret source: Actions
2023-07-01T19:43:23.7607216Z Prepare workflow directory
2023-07-01T19:43:23.8343540Z Prepare all required actions
2023-07-01T19:43:23.8534827Z Getting action download info
2023-07-01T19:43:24.0881944Z Download action repository 'actions/checkout@v3' (SHA:c85c95e3d7251135ab7dc9ce3241c5835cc595a9)
2023-07-01T19:43:24.9608826Z Download action repository 'shivammathur/setup-php@v2' (SHA:4bd44f22a98a19e0950cbad5f31095157cc9621b)
2023-07-01T19:43:25.6319014Z Download action repository 'ramsey/composer-install@v2' (SHA:12e7194f379a3773679641adfdfdade1eea3c086)
2023-07-01T19:43:26.1771532Z Getting action download info
2023-07-01T19:43:26.3265492Z Download action repository 'actions/cache@v3' (SHA:88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8)
2023-07-01T19:43:27.2760425Z Uses: ghostwriter/compliance/.github/workflows/automation.yml@refs/heads/v1 (3bf14b28b941722c423f8171861d927f41466e4b)
2023-07-01T19:43:27.2762221Z Complete job name: automation / ECS on PHP 8.1 with highest dependencies
2023-07-01T19:43:27.3560121Z ##[group]Run actions/checkout@v3
2023-07-01T19:43:27.3560414Z with:
2023-07-01T19:43:27.3560722Z   repository: ghostwriter/psalm-plugin-tester
2023-07-01T19:43:27.3561249Z   token: ***
2023-07-01T19:43:27.3561451Z   ssh-strict: true
2023-07-01T19:43:27.3561706Z   persist-credentials: true
2023-07-01T19:43:27.3561951Z   clean: true
2023-07-01T19:43:27.3562194Z   sparse-checkout-cone-mode: true
2023-07-01T19:43:27.3562452Z   fetch-depth: 1
2023-07-01T19:43:27.3562681Z   lfs: false
2023-07-01T19:43:27.3562883Z   submodules: false
2023-07-01T19:43:27.3563149Z   set-safe-directory: true
2023-07-01T19:43:27.3563452Z ##[endgroup]
2023-07-01T19:43:27.6367598Z Syncing repository: ghostwriter/psalm-plugin-tester
2023-07-01T19:43:27.6369345Z ##[group]Getting Git version info
2023-07-01T19:43:27.6369917Z Working directory is '/home/runner/work/psalm-plugin-tester/psalm-plugin-tester'
2023-07-01T19:43:27.6371358Z [command]/usr/bin/git version
2023-07-01T19:43:27.6430417Z git version 2.41.0
2023-07-01T19:43:27.6457359Z ##[endgroup]
2023-07-01T19:43:27.6475212Z Temporarily overriding HOME='/home/runner/work/_temp/e1260041-712a-4c82-b995-fa68573df6ad' before making global git config changes
2023-07-01T19:43:27.6476858Z Adding repository directory to the temporary git global config as a safe directory
2023-07-01T19:43:27.6501252Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/psalm-plugin-tester/psalm-plugin-tester
2023-07-01T19:43:27.6537129Z Deleting the contents of '/home/runner/work/psalm-plugin-tester/psalm-plugin-tester'
2023-07-01T19:43:27.6542788Z ##[group]Initializing the repository
2023-07-01T19:43:27.6546702Z [command]/usr/bin/git init /home/runner/work/psalm-plugin-tester/psalm-plugin-tester
2023-07-01T19:43:27.6633273Z hint: Using 'master' as the name for the initial branch. This default branch name
2023-07-01T19:43:27.6634176Z hint: is subject to change. To configure the initial branch name to use in all
2023-07-01T19:43:27.6634993Z hint: of your new repositories, which will suppress this warning, call:
2023-07-01T19:43:27.6635285Z hint: 
2023-07-01T19:43:27.6635745Z hint: 	git config --global init.defaultBranch <name>
2023-07-01T19:43:27.6635993Z hint: 
2023-07-01T19:43:27.6636357Z hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
2023-07-01T19:43:27.6636834Z hint: 'development'. The just-created branch can be renamed via this command:
2023-07-01T19:43:27.6637113Z hint: 
2023-07-01T19:43:27.6637378Z hint: 	git branch -m <name>
2023-07-01T19:43:27.6646644Z Initialized empty Git repository in /home/runner/work/psalm-plugin-tester/psalm-plugin-tester/.git/
2023-07-01T19:43:27.6661247Z [command]/usr/bin/git remote add origin https://github.com/ghostwriter/psalm-plugin-tester
2023-07-01T19:43:27.6705688Z ##[endgroup]
2023-07-01T19:43:27.6706477Z ##[group]Disabling automatic garbage collection
2023-07-01T19:43:27.6709493Z [command]/usr/bin/git config --local gc.auto 0
2023-07-01T19:43:27.6742925Z ##[endgroup]
2023-07-01T19:43:27.6743549Z ##[group]Setting up auth
2023-07-01T19:43:27.6749535Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2023-07-01T19:43:27.6783114Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2023-07-01T19:43:27.7180237Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2023-07-01T19:43:27.7213268Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2023-07-01T19:43:27.7438903Z [command]/usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic ***
2023-07-01T19:43:27.7478572Z ##[endgroup]
2023-07-01T19:43:27.7479291Z ##[group]Fetching the repository
2023-07-01T19:43:27.7488579Z [command]/usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +a608ac19d07733d8ef207a8bd34bb45adc7cd93e:refs/remotes/origin/main
2023-07-01T19:43:28.1389507Z remote: Enumerating objects: 39, done.        
2023-07-01T19:43:28.1404326Z remote: Counting objects:   2% (1/39)        
2023-07-01T19:43:28.1405233Z remote: Counting objects:   5% (2/39)        
2023-07-01T19:43:28.1405688Z remote: Counting objects:   7% (3/39)        
2023-07-01T19:43:28.1406349Z remote: Counting objects:  10% (4/39)        
2023-07-01T19:43:28.1406801Z remote: Counting objects:  12% (5/39)        
2023-07-01T19:43:28.1407449Z remote: Counting objects:  15% (6/39)        
2023-07-01T19:43:28.1408004Z remote: Counting objects:  17% (7/39)        
2023-07-01T19:43:28.1408669Z remote: Counting objects:  20% (8/39)        
2023-07-01T19:43:28.1409113Z remote: Counting objects:  23% (9/39)        
2023-07-01T19:43:28.1409763Z remote: Counting objects:  25% (10/39)        
2023-07-01T19:43:28.1410238Z remote: Counting objects:  28% (11/39)        
2023-07-01T19:43:28.1410897Z remote: Counting objects:  30% (12/39)        
2023-07-01T19:43:28.1411350Z remote: Counting objects:  33% (13/39)        
2023-07-01T19:43:28.1411989Z remote: Counting objects:  35% (14/39)        
2023-07-01T19:43:28.1412435Z remote: Counting objects:  38% (15/39)        
2023-07-01T19:43:28.1413073Z remote: Counting objects:  41% (16/39)        
2023-07-01T19:43:28.1413795Z remote: Counting objects:  43% (17/39)        
2023-07-01T19:43:28.1414435Z remote: Counting objects:  46% (18/39)        
2023-07-01T19:43:28.1414877Z remote: Counting objects:  48% (19/39)        
2023-07-01T19:43:28.1415532Z remote: Counting objects:  51% (20/39)        
2023-07-01T19:43:28.1415980Z remote: Counting objects:  53% (21/39)        
2023-07-01T19:43:28.1416603Z remote: Counting objects:  56% (22/39)        
2023-07-01T19:43:28.1417041Z remote: Counting objects:  58% (23/39)        
2023-07-01T19:43:28.1417991Z remote: Counting objects:  61% (24/39)        
2023-07-01T19:43:28.1418457Z remote: Counting objects:  64% (25/39)        
2023-07-01T19:43:28.1419119Z remote: Counting objects:  66% (26/39)        
2023-07-01T19:43:28.1419782Z remote: Counting objects:  69% (27/39)        
2023-07-01T19:43:28.1420773Z remote: Counting objects:  71% (28/39)        
2023-07-01T19:43:28.1421112Z remote: Counting objects:  74% (29/39)        
2023-07-01T19:43:28.1421650Z remote: Counting objects:  76% (30/39)        
2023-07-01T19:43:28.1422769Z remote: Counting objects:  79% (31/39)        
2023-07-01T19:43:28.1423221Z remote: Counting objects:  82% (32/39)        
2023-07-01T19:43:28.1424014Z remote: Counting objects:  84% (33/39)        
2023-07-01T19:43:28.1424708Z remote: Counting objects:  87% (34/39)        
2023-07-01T19:43:28.1425300Z remote: Counting objects:  89% (35/39)        
2023-07-01T19:43:28.1425994Z remote: Counting objects:  92% (36/39)        
2023-07-01T19:43:28.1426653Z remote: Counting objects:  94% (37/39)        
2023-07-01T19:43:28.1427184Z remote: Counting objects:  97% (38/39)        
2023-07-01T19:43:28.1427763Z remote: Counting objects: 100% (39/39)        
2023-07-01T19:43:28.1428363Z remote: Counting objects: 100% (39/39), done.        
2023-07-01T19:43:28.1674659Z remote: Compressing objects:   3% (1/29)        
2023-07-01T19:43:28.1676454Z remote: Compressing objects:   6% (2/29)        
2023-07-01T19:43:28.1677817Z remote: Compressing objects:  10% (3/29)        
2023-07-01T19:43:28.1678151Z remote: Compressing objects:  13% (4/29)        
2023-07-01T19:43:28.1678857Z remote: Compressing objects:  17% (5/29)        
2023-07-01T19:43:28.1679559Z remote: Compressing objects:  20% (6/29)        
2023-07-01T19:43:28.1679891Z remote: Compressing objects:  24% (7/29)        
2023-07-01T19:43:28.1680939Z remote: Compressing objects:  27% (8/29)        
2023-07-01T19:43:28.1681276Z remote: Compressing objects:  31% (9/29)        
2023-07-01T19:43:28.1681604Z remote: Compressing objects:  34% (10/29)        
2023-07-01T19:43:28.1683010Z remote: Compressing objects:  37% (11/29)        
2023-07-01T19:43:28.1683761Z remote: Compressing objects:  41% (12/29)        
2023-07-01T19:43:28.1684474Z remote: Compressing objects:  44% (13/29)        
2023-07-01T19:43:28.1684811Z remote: Compressing objects:  48% (14/29)        
2023-07-01T19:43:28.1685524Z remote: Compressing objects:  51% (15/29)        
2023-07-01T19:43:28.1686226Z remote: Compressing objects:  55% (16/29)        
2023-07-01T19:43:28.1686556Z remote: Compressing objects:  58% (17/29)        
2023-07-01T19:43:28.1686872Z remote: Compressing objects:  62% (18/29)        
2023-07-01T19:43:28.1687960Z remote: Compressing objects:  65% (19/29)        
2023-07-01T19:43:28.1688296Z remote: Compressing objects:  68% (20/29)        
2023-07-01T19:43:28.1688626Z remote: Compressing objects:  72% (21/29)        
2023-07-01T19:43:28.1688943Z remote: Compressing objects:  75% (22/29)        
2023-07-01T19:43:28.1689653Z remote: Compressing objects:  79% (23/29)        
2023-07-01T19:43:28.1690371Z remote: Compressing objects:  82% (24/29)        
2023-07-01T19:43:28.1690684Z remote: Compressing objects:  86% (25/29)        
2023-07-01T19:43:28.1691173Z remote: Compressing objects:  89% (26/29)        
2023-07-01T19:43:28.1691496Z remote: Compressing objects:  93% (27/29)        
2023-07-01T19:43:28.1691948Z remote: Compressing objects:  96% (28/29)        
2023-07-01T19:43:28.1693500Z remote: Compressing objects: 100% (29/29)        
2023-07-01T19:43:28.1694015Z remote: Compressing objects: 100% (29/29), done.        
2023-07-01T19:43:28.1965563Z remote: Total 39 (delta 0), reused 19 (delta 0), pack-reused 0        
2023-07-01T19:43:28.2054515Z From https://github.com/ghostwriter/psalm-plugin-tester
2023-07-01T19:43:28.2055309Z  * [new ref]         a608ac19d07733d8ef207a8bd34bb45adc7cd93e -> origin/main
2023-07-01T19:43:28.2083406Z ##[endgroup]
2023-07-01T19:43:28.2084042Z ##[group]Determining the checkout info
2023-07-01T19:43:28.2085472Z ##[endgroup]
2023-07-01T19:43:28.2086405Z ##[group]Checking out the ref
2023-07-01T19:43:28.2091677Z [command]/usr/bin/git checkout --progress --force -B main refs/remotes/origin/main
2023-07-01T19:43:28.2173265Z Switched to a new branch 'main'
2023-07-01T19:43:28.2177860Z branch 'main' set up to track 'origin/main'.
2023-07-01T19:43:28.2183258Z ##[endgroup]
2023-07-01T19:43:28.2226553Z [command]/usr/bin/git log -1 --format='%H'
2023-07-01T19:43:28.2256077Z 'a608ac19d07733d8ef207a8bd34bb45adc7cd93e'
2023-07-01T19:43:28.2582570Z ##[group]Run shivammathur/setup-php@v2
2023-07-01T19:43:28.2582854Z with:
2023-07-01T19:43:28.2583046Z   coverage: pcov
2023-07-01T19:43:28.2583407Z   ini-values: assert.exception=1, zend.assertions=1, error_reporting=-1, log_errors_max_len=0, display_errors=On
2023-07-01T19:43:28.2583766Z   php-version: 8.1
2023-07-01T19:43:28.2584023Z   tools: psalm, phpstan, cs2pr, phpcs, phpunit
2023-07-01T19:43:28.2584295Z   ini-file: production
2023-07-01T19:43:28.2584508Z ##[endgroup]
2023-07-01T19:43:28.9662006Z [command]/usr/bin/bash /home/runner/work/_actions/shivammathur/setup-php/v2/src/scripts/run.sh
2023-07-01T19:43:28.9782708Z 
2023-07-01T19:43:28.9783256Z �[90;1m==> �[0m�[37;1mSetup PHP�[0m
2023-07-01T19:43:38.5491996Z �[32;1m✓ �[0m�[34;1mPHP �[0m�[90;1mUpdated to PHP 8.1.20�[0m
2023-07-01T19:43:38.5492618Z 
2023-07-01T19:43:38.5493829Z �[90;1m==> �[0m�[37;1mSetup Tools�[0m
2023-07-01T19:43:39.3109045Z �[32;1m✓ �[0m�[34;1mcomposer �[0m�[90;1mAdded composer 2.5.8�[0m
2023-07-01T19:43:40.3926737Z �[32;1m✓ �[0m�[34;1mpsalm �[0m�[90;1mAdded psalm �[0m
2023-07-01T19:43:41.7787342Z �[32;1m✓ �[0m�[34;1mphpstan �[0m�[90;1mAdded phpstan 1.10.22�[0m
2023-07-01T19:43:42.3480156Z �[32;1m✓ �[0m�[34;1mcs2pr �[0m�[90;1mAdded cs2pr 1.8.5�[0m
2023-07-01T19:43:43.0744461Z �[32;1m✓ �[0m�[34;1mphpcs �[0m�[90;1mAdded phpcs 3.7.2�[0m
2023-07-01T19:43:43.4772759Z �[32;1m✓ �[0m�[34;1mphpunit �[0m�[90;1mAdded phpunit 10.2.3�[0m
2023-07-01T19:43:43.4773484Z 
2023-07-01T19:43:43.4815433Z �[90;1m==> �[0m�[37;1mSetup Coverage�[0m
2023-07-01T19:43:43.6794487Z �[32;1m✓ �[0m�[34;1mpcov.enabled=1 �[0m�[90;1mAdded to php.ini�[0m
2023-07-01T19:43:43.7340613Z �[32;1m✓ �[0m�[34;1mpcov �[0m�[90;1mPCOV 1.0.11 enabled as coverage driver�[0m
2023-07-01T19:43:43.7340912Z 
2023-07-01T19:43:43.7341128Z �[90;1m==> �[0m�[37;1mAdd php.ini values�[0m
2023-07-01T19:43:43.7428660Z �[32;1m✓ �[0m�[34;1massert.exception=1 �[0m�[90;1mAdded to php.ini�[0m
2023-07-01T19:43:43.7429686Z �[32;1m✓ �[0m�[34;1mzend.assertions=1 �[0m�[90;1mAdded to php.ini�[0m
2023-07-01T19:43:43.7430417Z �[32;1m✓ �[0m�[34;1merror_reporting=-1 �[0m�[90;1mAdded to php.ini�[0m
2023-07-01T19:43:43.7431038Z �[32;1m✓ �[0m�[34;1mlog_errors_max_len=0 �[0m�[90;1mAdded to php.ini�[0m
2023-07-01T19:43:43.7431703Z �[32;1m✓ �[0m�[34;1mdisplay_errors=On �[0m�[90;1mAdded to php.ini�[0m
2023-07-01T19:43:43.7448731Z 
2023-07-01T19:43:43.7449420Z �[90;1m==> �[0m�[37;1m#StandWithUkraine�[0m
2023-07-01T19:43:43.7450151Z �[32;1m✓ �[0m�[34;1mread-more �[0m�[90;1mhttps://setup-php.com/support-ukraine�[0m
2023-07-01T19:43:43.7566722Z ##[group]Run echo "::add-matcher::/opt/hostedtoolcache/php.json"
2023-07-01T19:43:43.7567200Z �[36;1mecho "::add-matcher::/opt/hostedtoolcache/php.json"�[0m
2023-07-01T19:43:43.7567635Z �[36;1mecho "::add-matcher::/opt/hostedtoolcache/phpunit.json"�[0m
2023-07-01T19:43:43.7627581Z shell: /usr/bin/bash -e {0}
2023-07-01T19:43:43.7627854Z env:
2023-07-01T19:43:43.7628157Z   COMPOSER_PROCESS_TIMEOUT: 0
2023-07-01T19:43:43.7628567Z   COMPOSER_NO_INTERACTION: 1
2023-07-01T19:43:43.7628832Z   COMPOSER_NO_AUDIT: 1
2023-07-01T19:43:43.7629142Z ##[endgroup]
2023-07-01T19:43:43.7896649Z ##[group]Run ramsey/composer-install@v2
2023-07-01T19:43:43.7896990Z with:
2023-07-01T19:43:43.7897274Z env:
2023-07-01T19:43:43.7897516Z   COMPOSER_PROCESS_TIMEOUT: 0
2023-07-01T19:43:43.7897907Z   COMPOSER_NO_INTERACTION: 1
2023-07-01T19:43:43.7898217Z   COMPOSER_NO_AUDIT: 1
2023-07-01T19:43:43.7898466Z ##[endgroup]
2023-07-01T19:43:43.8119851Z ##[group]Run ${GITHUB_ACTION_PATH}/bin/php_version.sh
2023-07-01T19:43:43.8120501Z �[36;1m${GITHUB_ACTION_PATH}/bin/php_version.sh�[0m
2023-07-01T19:43:43.8176531Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2023-07-01T19:43:43.8177057Z env:
2023-07-01T19:43:43.8177300Z   COMPOSER_PROCESS_TIMEOUT: 0
2023-07-01T19:43:43.8177635Z   COMPOSER_NO_INTERACTION: 1
2023-07-01T19:43:43.8177943Z   COMPOSER_NO_AUDIT: 1
2023-07-01T19:43:43.8178182Z ##[endgroup]
2023-07-01T19:43:43.9457587Z ##[group]Run ${GITHUB_ACTION_PATH}/bin/should_cache.sh ""
2023-07-01T19:43:43.9457939Z �[36;1m${GITHUB_ACTION_PATH}/bin/should_cache.sh ""�[0m
2023-07-01T19:43:43.9513526Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2023-07-01T19:43:43.9513794Z env:
2023-07-01T19:43:43.9514020Z   COMPOSER_PROCESS_TIMEOUT: 0
2023-07-01T19:43:43.9514271Z   COMPOSER_NO_INTERACTION: 1
2023-07-01T19:43:43.9514496Z   COMPOSER_NO_AUDIT: 1
2023-07-01T19:43:43.9514718Z ##[endgroup]
2023-07-01T19:43:43.9663763Z ##[group]Run ${GITHUB_ACTION_PATH}/bin/composer_paths.sh \
2023-07-01T19:43:43.9664152Z �[36;1m${GITHUB_ACTION_PATH}/bin/composer_paths.sh \�[0m
2023-07-01T19:43:43.9664415Z �[36;1m  "" \�[0m
2023-07-01T19:43:43.9664596Z �[36;1m  "" \�[0m
2023-07-01T19:43:43.9664804Z �[36;1m  "/usr/bin/php"�[0m
2023-07-01T19:43:43.9714089Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2023-07-01T19:43:43.9714365Z env:
2023-07-01T19:43:43.9714586Z   COMPOSER_PROCESS_TIMEOUT: 0
2023-07-01T19:43:43.9714826Z   COMPOSER_NO_INTERACTION: 1
2023-07-01T19:43:43.9715066Z   COMPOSER_NO_AUDIT: 1
2023-07-01T19:43:43.9715284Z ##[endgroup]
2023-07-01T19:43:44.6935389Z ##[group]Run ${GITHUB_ACTION_PATH}/bin/cache_key.sh \
2023-07-01T19:43:44.6935724Z �[36;1m${GITHUB_ACTION_PATH}/bin/cache_key.sh \�[0m
2023-07-01T19:43:44.6935984Z �[36;1m  "Linux" \�[0m
2023-07-01T19:43:44.6936195Z �[36;1m  "8.1.20" \�[0m
2023-07-01T19:43:44.6936384Z �[36;1m  "" \�[0m
2023-07-01T19:43:44.6936578Z �[36;1m  "" \�[0m
2023-07-01T19:43:44.6936884Z �[36;1m  "b619f299fb03a570a4a0af7f304aa547b70bbfdcd115619c20a806660a0c2e09" \�[0m
2023-07-01T19:43:44.6937197Z �[36;1m  "" \�[0m
2023-07-01T19:43:44.6937378Z �[36;1m  "" \�[0m
2023-07-01T19:43:44.6937564Z �[36;1m  ""�[0m
2023-07-01T19:43:44.6992428Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
2023-07-01T19:43:44.6992706Z env:
2023-07-01T19:43:44.6992934Z   COMPOSER_PROCESS_TIMEOUT: 0
2023-07-01T19:43:44.6993175Z   COMPOSER_NO_INTERACTION: 1
2023-07-01T19:43:44.6993413Z   COMPOSER_NO_AUDIT: 1
2023-07-01T19:43:44.6993634Z ##[endgroup]
2023-07-01T19:43:44.7223085Z ##[group]Run actions/cache@v3
2023-07-01T19:43:44.7223304Z with:
2023-07-01T19:43:44.7223545Z   path: /home/runner/.cache/composer
2023-07-01T19:43:44.7224036Z   key: Linux-php-8.1.20-composer-locked-b619f299fb03a570a4a0af7f304aa547b70bbfdcd115619c20a806660a0c2e09
2023-07-01T19:43:44.7224549Z   restore-keys: Linux-php-8.1.20-composer-locked-

2023-07-01T19:43:44.7224860Z   enableCrossOsArchive: false
2023-07-01T19:43:44.7225117Z   fail-on-cache-miss: false
2023-07-01T19:43:44.7225342Z   lookup-only: false
2023-07-01T19:43:44.7225559Z env:
2023-07-01T19:43:44.7225768Z   COMPOSER_PROCESS_TIMEOUT: 0
2023-07-01T19:43:44.7225999Z   COMPOSER_NO_INTERACTION: 1
2023-07-01T19:43:44.7226229Z   COMPOSER_NO_AUDIT: 1
2023-07-01T19:43:44.7226517Z   CACHE_RESTORE_KEY: Linux-php-8.1.20-composer-locked-
2023-07-01T19:43:44.7226782Z ##[endgroup]
2023-07-01T19:43:46.3611239Z Received 5203550 of 21980766 (23.7%), 5.0 MBs/sec
2023-07-01T19:43:47.3623789Z Received 17786462 of 21980766 (80.9%), 8.5 MBs/sec
2023-07-01T19:43:48.3637866Z Received 17786462 of 21980766 (80.9%), 5.6 MBs/sec
2023-07-01T19:43:49.3653243Z Received 17786462 of 21980766 (80.9%), 4.2 MBs/sec
2023-07-01T19:43:50.3666937Z Received 17786462 of 21980766 (80.9%), 3.4 MBs/sec
2023-07-01T19:43:51.3682461Z Received 17786462 of 21980766 (80.9%), 2.8 MBs/sec
2023-07-01T19:43:52.3695805Z Received 17786462 of 21980766 (80.9%), 2.4 MBs/sec
2023-07-01T19:43:53.3700982Z Received 17786462 of 21980766 (80.9%), 2.1 MBs/sec
2023-07-01T19:43:54.3719802Z Received 17786462 of 21980766 (80.9%), 1.9 MBs/sec
2023-07-01T19:43:55.3738421Z Received 17786462 of 21980766 (80.9%), 1.7 MBs/sec
2023-07-01T19:43:56.3751826Z Received 17786462 of 21980766 (80.9%), 1.5 MBs/sec
2023-07-01T19:43:57.3766642Z Received 17786462 of 21980766 (80.9%), 1.4 MBs/sec
2023-07-01T19:43:58.3782191Z Received 17786462 of 21980766 (80.9%), 1.3 MBs/sec
2023-07-01T19:43:59.3795517Z Received 17786462 of 21980766 (80.9%), 1.2 MBs/sec
2023-07-01T19:44:00.3810859Z Received 17786462 of 21980766 (80.9%), 1.1 MBs/sec
2023-07-01T19:44:01.3808333Z Received 17786462 of 21980766 (80.9%), 1.1 MBs/sec
2023-07-01T19:44:02.3825077Z Received 17786462 of 21980766 (80.9%), 1.0 MBs/sec
2023-07-01T19:44:03.3837340Z Received 17786462 of 21980766 (80.9%), 0.9 MBs/sec
2023-07-01T19:44:04.3850344Z Received 17786462 of 21980766 (80.9%), 0.9 MBs/sec
2023-07-01T19:44:05.3862805Z Received 17786462 of 21980766 (80.9%), 0.8 MBs/sec
2023-07-01T19:44:06.3876766Z Received 17786462 of 21980766 (80.9%), 0.8 MBs/sec
2023-07-01T19:44:07.3890939Z Received 17786462 of 21980766 (80.9%), 0.8 MBs/sec
2023-07-01T19:44:08.3902530Z Received 17786462 of 21980766 (80.9%), 0.7 MBs/sec
2023-07-01T19:44:09.3915201Z Received 17786462 of 21980766 (80.9%), 0.7 MBs/sec
2023-07-01T19:44:10.3931700Z Received 17786462 of 21980766 (80.9%), 0.7 MBs/sec
2023-07-01T19:44:11.3935577Z Received 17786462 of 21980766 (80.9%), 0.7 MBs/sec
2023-07-01T19:44:12.3947934Z Received 17786462 of 21980766 (80.9%), 0.6 MBs/sec
2023-07-01T19:44:13.3962466Z Received 17786462 of 21980766 (80.9%), 0.6 MBs/sec
2023-07-01T19:44:14.3975790Z Received 17786462 of 21980766 (80.9%), 0.6 MBs/sec
2023-07-01T19:44:15.3984269Z Received 17786462 of 21980766 (80.9%), 0.6 MBs/sec
2023-07-01T19:44:16.3998556Z Received 17786462 of 21980766 (80.9%), 0.5 MBs/sec
2023-07-01T19:44:17.4010650Z Received 17786462 of 21980766 (80.9%), 0.5 MBs/sec
2023-07-01T19:44:18.4025645Z Received 17786462 of 21980766 (80.9%), 0.5 MBs/sec
2023-07-01T19:44:19.4037361Z Received 17786462 of 21980766 (80.9%), 0.5 MBs/sec
2023-07-01T19:44:20.4052468Z Received 17786462 of 21980766 (80.9%), 0.5 MBs/sec
2023-07-01T19:44:21.4064887Z Received 17786462 of 21980766 (80.9%), 0.5 MBs/sec
2023-07-01T19:44:22.4078243Z Received 17786462 of 21980766 (80.9%), 0.5 MBs/sec
2023-07-01T19:44:23.4093323Z Received 17786462 of 21980766 (80.9%), 0.4 MBs/sec
2023-07-01T19:44:24.4106536Z Received 17786462 of 21980766 (80.9%), 0.4 MBs/sec
2023-07-01T19:44:25.4120160Z Received 17786462 of 21980766 (80.9%), 0.4 MBs/sec
2023-07-01T19:44:26.4135005Z Received 17786462 of 21980766 (80.9%), 0.4 MBs/sec
2023-07-01T19:44:27.4144398Z Received 17786462 of 21980766 (80.9%), 0.4 MBs/sec
2023-07-01T19:44:28.4157275Z Received 17786462 of 21980766 (80.9%), 0.4 MBs/sec
2023-07-01T19:44:29.4170420Z Received 17786462 of 21980766 (80.9%), 0.4 MBs/sec
2023-07-01T19:44:30.4183498Z Received 17786462 of 21980766 (80.9%), 0.4 MBs/sec
2023-07-01T19:44:31.4195821Z Received 17786462 of 21980766 (80.9%), 0.4 MBs/sec
2023-07-01T19:44:32.4208575Z Received 17786462 of 21980766 (80.9%), 0.4 MBs/sec
2023-07-01T19:44:33.4222651Z Received 17786462 of 21980766 (80.9%), 0.4 MBs/sec
2023-07-01T19:44:34.4235618Z Received 17786462 of 21980766 (80.9%), 0.3 MBs/sec
2023-07-01T19:44:35.4249356Z Received 17786462 of 21980766 (80.9%), 0.3 MBs/sec
2023-07-01T19:44:36.4264488Z Received 17786462 of 21980766 (80.9%), 0.3 MBs/sec
2023-07-01T19:44:37.4277056Z Received 17786462 of 21980766 (80.9%), 0.3 MBs/sec
2023-07-01T19:44:38.4292195Z Received 17786462 of 21980766 (80.9%), 0.3 MBs/sec
2023-07-01T19:44:39.4304753Z Received 17786462 of 21980766 (80.9%), 0.3 MBs/sec
2023-07-01T19:44:40.4318487Z Received 17786462 of 21980766 (80.9%), 0.3 MBs/sec
2023-07-01T19:44:41.4330741Z Received 17786462 of 21980766 (80.9%), 0.3 MBs/sec
2023-07-01T19:44:42.4344771Z Received 17786462 of 21980766 (80.9%), 0.3 MBs/sec
2023-07-01T19:44:43.4360037Z Received 17786462 of 21980766 (80.9%), 0.3 MBs/sec
2023-07-01T19:44:44.4371208Z Received 17786462 of 21980766 (80.9%), 0.3 MBs/sec
2023-07-01T19:44:45.4386468Z Received 17786462 of 21980766 (80.9%), 0.3 MBs/sec
2023-07-01T19:44:46.4399652Z Received 17786462 of 21980766 (80.9%), 0.3 MBs/sec
2023-07-01T19:44:47.4412885Z Received 17786462 of 21980766 (80.9%), 0.3 MBs/sec
2023-07-01T19:44:48.4425984Z Received 17786462 of 21980766 (80.9%), 0.3 MBs/sec
2023-07-01T19:44:49.4438701Z Received 17786462 of 21980766 (80.9%), 0.3 MBs/sec
2023-07-01T19:44:50.4451609Z Received 17786462 of 21980766 (80.9%), 0.3 MBs/sec
2023-07-01T19:44:51.4466314Z Received 17786462 of 21980766 (80.9%), 0.3 MBs/sec
2023-07-01T19:44:52.4480991Z Received 17786462 of 21980766 (80.9%), 0.3 MBs/sec
2023-07-01T19:44:53.4494284Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:44:54.4509664Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:44:55.4522026Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:44:56.4535056Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:44:57.4550302Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:44:58.4564343Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:44:59.4575372Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:00.4589346Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:01.4603106Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:02.4618534Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:03.4631784Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:04.4644618Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:05.4657933Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:06.4671387Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:07.4686078Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:08.4698318Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:09.4712306Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:10.4724761Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:11.4738374Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:12.4744326Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:13.4758496Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:14.4772092Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:15.4784144Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:16.4798344Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:17.4810709Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:18.4813063Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:19.4827574Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:20.4828798Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:21.4841840Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:22.4855045Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:23.4868007Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:24.4876346Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:25.4881901Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:25.6171200Z Received 17786462 of 21980766 (80.9%), 0.2 MBs/sec
2023-07-01T19:45:25.6211265Z ##[warning]Failed to restore: The operation cannot be completed in timeout.
2023-07-01T19:45:25.6212921Z Cache not found for input keys: Linux-php-8.1.20-composer-locked-b619f299fb03a570a4a0af7f304aa547b70bbfdcd115619c20a806660a0c2e09, Linux-php-8.1.20-composer-locked-
2023-07-01T22:49:50.0546834Z ##[error]The operation was canceled.
2023-07-01T22:49:50.0632850Z Post job cleanup.
2023-07-01T22:49:50.0675800Z Post job cleanup.
2023-07-01T22:49:50.1718367Z [command]/usr/bin/git version
2023-07-01T22:49:50.1804803Z git version 2.41.0
2023-07-01T22:49:50.1857097Z Temporarily overriding HOME='/home/runner/work/_temp/afa29411-aa38-4fae-84e7-21e96aaade43' before making global git config changes
2023-07-01T22:49:50.1858137Z Adding repository directory to the temporary git global config as a safe directory
2023-07-01T22:49:50.1864555Z [command]/usr/bin/git config --global --add safe.directory /home/runner/work/psalm-plugin-tester/psalm-plugin-tester
2023-07-01T22:49:50.1921643Z [command]/usr/bin/git config --local --name-only --get-regexp core\.sshCommand
2023-07-01T22:49:50.2025300Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
2023-07-01T22:49:50.2280292Z [command]/usr/bin/git config --local --name-only --get-regexp http\.https\:\/\/github\.com\/\.extraheader
2023-07-01T22:49:50.2313279Z http.https://github.com/.extraheader
2023-07-01T22:49:50.2325619Z [command]/usr/bin/git config --local --unset-all http.https://github.com/.extraheader
2023-07-01T22:49:50.2380948Z [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
2023-07-01T22:49:50.2889918Z Cleaning up orphan processes

Environment details

  • version of this package: v2
  • PHP version:8.1.20
  • OS: Linux

Additional context

2023-07-01T19:45:25.6211265Z ##[warning]Failed to restore: The operation cannot be completed in timeout.
2023-07-01T19:45:25.6212921Z Cache not found for input keys: Linux-php-8.1.20-composer-locked-b619f299fb03a570a4a0af7f304aa547b70bbfdcd115619c20a806660a0c2e09, Linux-php-8.1.20-composer-locked-
2023-07-01T22:49:50.0546834Z ##[error]The operation was canceled. (manually canceled)
2023-07-01T22:49:50.0632850Z Post job cleanup.

Action will not work if composer.json is located in a sub dir

Hi, thanks for this amazing tool 👍

This is my project strucure in short:

.github/workflows/ci.yaml
...
backend/composer.json
...
frontend/package.json
...

I tried using (working-directory, this is what other action use):

            -
                name: "Composer install"
                uses: "ramsey/composer-install@v1"
                working-directory: "backend"
                with:
                    composer-options: "--no-scripts"

and:

            -
                name: "Composer install"
                uses: "ramsey/composer-install@v1"
                with:
                    composer-options: "--no-scripts --working-dir=backend"

but this does not work 🤔 I don't have that much info:
CleanShot 2020-11-17 at 08 05 48

Thank you!

cc @localheinz

don't re-install dependencies after cache restore

I am doing dependency caching the manual way and just found out about this package.
it seems to be a time saver <3. thanks for this great package.

I did some initial tests and it seems to work like expected. I noticed though, that the composer installation process is still triggered on a cache hit.

I learned today in a different github action, that invoking composer install after a successfull restore is unnecessary.

wdyt.. could we save this call and the few seconds this requires when running the action on a cache hit?

File "./composer.json" cannot be found in the current directory

Description

I keep seeing the above message in build logs, see details below.

Run ramsey/[email protected]
Run ${GITHUB_ACTION_PATH}/bin/php_version.sh
Run ${GITHUB_ACTION_PATH}/bin/should_cache.sh ""
Run ${GITHUB_ACTION_PATH}/bin/composer_paths.sh
${GITHUB_ACTION_PATH}/bin/composer_paths.sh
""
"....."
"/usr/bin/php"
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
COMPOSER_PROCESS_TIMEOUT: 0
COMPOSER_NO_INTERACTION: 1
COMPOSER_NO_AUDIT: 1
CACHE_RESTORE_KEY: Linux-php-8.1.21-composer-locked-......

In ConfigCommand.php line 217:

File "./composer.json" cannot be found in the current directory

config [-g|--global] [-e|--editor] [-a|--auth] [--unset] [-l|--list] [-f|--file FILE] [--absolute] [-j|--json] [-m|--merge] [--append] [--source] [--] [ [...]]

Steps to reproduce

Expected behavior

Screenshots or output

Environment details

IMO N/A

Additional context

Switch to actions/cache@v4

actions/cache@v4 was released a couple of weeks ago and moves to Node 20. Please update your reference to use the new version:
https://github.com/actions/cache/releases/tag/v4.0.0

Description

When using composer-install I get this message:

Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/cache@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

Steps to reproduce

Run a workflow containing composer-install

Expected behavior

Use latest version of actions/cache (v4)

Screenshots or output

image

Environment details

  • version of this package: ramsey/composer-install@v2
  • PHP version: 8.2
  • OS: Linux (Ubuntu latest)

Additional context

N/A

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.