Closed YoSoyElCapitan closed 1 year ago
I'm facing something like this, but my composer.json is on the root of the project:
name: Laravel E2E Tests
on:
push:
# Publish `main` as Docker `latest` image.
branches: [main]
# Publish `v1.2.3` tags as releases.
tags:
- v*
pull_request:
branches: [main]
tags:
- v*
# manually run a workflow
workflow_dispatch:
jobs:
laravel-tests:
strategy:
matrix:
os: [ubuntu-latest]
php: [7.4]
dependencies: [lowest, highest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mysqli, pdo_mysql, bcmath, gd
- uses: "ramsey/composer-install@v2"
with:
working-directory: ".." 🐛
dependency-versions: "${{ matrix.dependencies }}"
...
✅ fixed for me. That was something wrong with the use of the attribute "working-directory". I think it could not be inside quotation marks.
Hi, I have the same error but with no modification on the working director because it's the repo himself
Also getting this issue with a monorepo
path to composer.json
in repo: tests/phpunit/composer.json
workflow:
- name: Composer install
uses: 'ramsey/composer-install@v2'
with:
composer-options: ${{ inputs.composer-options }} --ansi
custom-cache-key: ${{ inputs.cache-key }}-${{ steps.timestamp.outputs.hour }}
dependency-versions: ${{ inputs.composer-dependencies }}
working-directory: ${{ inputs.composer-path }}
output:
Run ramsey/composer-install@v2
with:
composer-options: --optimize-autoloader --ignore-platform-reqs --ansi
custom-cache-key: Linux-***-lint-2022-09-29-19
dependency-versions: locked
working-directory: tests/phpunit
env:
COMPOSER_PROCESS_TIMEOUT: 0
COMPOSER_NO_INTERACTION: 1
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 \
"" \
"tests/phpunit" \
"/usr/bin/php"
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
COMPOSER_PROCESS_TIMEOUT: 0
COMPOSER_NO_INTERACTION: 1
In ConfigCommand.php line 202:
File "./composer.json" cannot be found in the current directory
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
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
Additional context
Custom cache keys does not solve this problem.