From f22409ebd8f983e505489e4a95daf19a40b4dce1 Mon Sep 17 00:00:00 2001 From: Ben Ramsey Date: Thu, 23 Dec 2021 17:02:51 -0600 Subject: [PATCH] fix: make working dir part of cache key and improve error handling --- .gitattributes | 1 - .github/workflows/continuous-integration.yml | 2 +- action.yml | 25 +- bin/cache_key.sh | 15 +- bin/composer_cache_dir.sh | 6 - bin/composer_install.sh | 4 +- bin/composer_paths.sh | 62 ++ bin/php_version.sh | 18 +- subdirectory/composer.json | 14 - subdirectory/composer.lock | 658 ------------------ tests/expect/cache_key_04.exp | 9 +- tests/expect/cache_key_06.exp | 29 + tests/expect/composer_cache_dir_01.exp | 9 - tests/expect/composer_install_09.exp | 4 +- tests/expect/composer_install_10.exp | 4 +- tests/expect/composer_install_11.exp | 4 +- tests/expect/composer_install_12.exp | 4 +- tests/expect/composer_install_13.exp | 4 +- tests/expect/composer_install_14.exp | 4 +- tests/expect/composer_install_15.exp | 4 +- tests/expect/composer_install_16.exp | 4 +- tests/expect/composer_paths_01.exp | 16 + tests/expect/composer_paths_02.exp | 8 + tests/expect/composer_paths_03.exp | 8 + tests/expect/composer_paths_04.exp | 8 + tests/expect/composer_paths_05.exp | 17 + tests/expect/composer_paths_06.exp | 16 + tests/expect/composer_paths_07.exp | 8 + tests/expect/php_version_01.exp | 7 +- tests/expect/php_version_02.exp | 8 + tests/expect/test-subdir/composer.json | 11 - tests/fixtures/invalid-composer/.gitignore | 1 + tests/fixtures/invalid-composer/composer.json | 4 + tests/fixtures/no-lock-file/.gitignore | 1 + tests/fixtures/no-lock-file/composer.json | 11 + tests/fixtures/non-composer/.gitkeep | 0 tests/fixtures/with-lock-file/composer.json | 11 + .../with-lock-file}/composer.lock | 2 +- 38 files changed, 281 insertions(+), 740 deletions(-) delete mode 100755 bin/composer_cache_dir.sh create mode 100755 bin/composer_paths.sh delete mode 100644 subdirectory/composer.json delete mode 100644 subdirectory/composer.lock create mode 100755 tests/expect/cache_key_06.exp delete mode 100755 tests/expect/composer_cache_dir_01.exp create mode 100755 tests/expect/composer_paths_01.exp create mode 100755 tests/expect/composer_paths_02.exp create mode 100755 tests/expect/composer_paths_03.exp create mode 100755 tests/expect/composer_paths_04.exp create mode 100755 tests/expect/composer_paths_05.exp create mode 100755 tests/expect/composer_paths_06.exp create mode 100755 tests/expect/composer_paths_07.exp create mode 100755 tests/expect/php_version_02.exp delete mode 100644 tests/expect/test-subdir/composer.json create mode 100644 tests/fixtures/invalid-composer/.gitignore create mode 100644 tests/fixtures/invalid-composer/composer.json create mode 100644 tests/fixtures/no-lock-file/.gitignore create mode 100644 tests/fixtures/no-lock-file/composer.json create mode 100644 tests/fixtures/non-composer/.gitkeep create mode 100644 tests/fixtures/with-lock-file/composer.json rename tests/{expect/test-subdir => fixtures/with-lock-file}/composer.lock (90%) diff --git a/.gitattributes b/.gitattributes index 7b418eb..d4932e3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -11,5 +11,4 @@ /conventional-commits.json export-ignore /docs/ export-ignore /SECURITY.md export-ignore -/subdirectory/ export-ignore /tests/ export-ignore diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 28ba294..f539e1d 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -40,7 +40,7 @@ jobs: - "--ignore-platform-reqs" - "" working-directory: - - "subdirectory" + - "tests/fixtures/with-lock-file" - "" ignore-cache: - "yes" diff --git a/action.yml b/action.yml index f419ebe..c03b00b 100644 --- a/action.yml +++ b/action.yml @@ -35,7 +35,7 @@ runs: using: "composite" steps: - name: "Determine PHP version" - id: "php-version" + id: "php" shell: "bash" run: "${GITHUB_ACTION_PATH}/bin/php_version.sh" @@ -44,30 +44,37 @@ runs: shell: "bash" run: "${GITHUB_ACTION_PATH}/bin/should_cache.sh \"${{ inputs.ignore-cache }}\"" - - name: "Determine Composer cache directory" - id: "composer-cache" + - name: "Determine Composer paths" + id: "composer" if: steps.should-cache.outputs.do-cache == 1 shell: "bash" - run: "${GITHUB_ACTION_PATH}/bin/composer_cache_dir.sh" + run: | + ${GITHUB_ACTION_PATH}/bin/composer_paths.sh \ + "" \ + "${{ inputs.working-directory }}" \ + "${{ steps.php.outputs.path }}" - name: "Determine cache key" id: "cache-key" if: steps.should-cache.outputs.do-cache == 1 shell: "bash" run: | + composer_json="${{ steps.composer.outputs.json }}" + composer_lock="${{ steps.composer.outputs.lock }}" ${GITHUB_ACTION_PATH}/bin/cache_key.sh \ "${{ runner.os }}" \ - "${{ steps.php-version.outputs.php }}" \ + "${{ steps.php.outputs.version }}" \ "${{ inputs.dependency-versions }}" \ "${{ inputs.composer-options }}" \ "${{ hashFiles('**/composer.json', '**/composer.lock') }}" \ - "${{ inputs.custom-cache-key }}" + "${{ inputs.custom-cache-key }}" \ + "${{ inputs.working-directory }}" - name: "Cache Composer dependencies" if: steps.should-cache.outputs.do-cache == 1 uses: "actions/cache@v2" with: - path: "${{ steps.composer-cache.outputs.directory }}" + path: "${{ steps.composer.outputs.cache-dir }}" key: "${{ steps.cache-key.outputs.key }}" restore-keys: | ${{ env.CACHE_RESTORE_KEY }} @@ -78,4 +85,6 @@ runs: ${GITHUB_ACTION_PATH}/bin/composer_install.sh \ "${{ inputs.dependency-versions }}" \ "${{ inputs.composer-options }}" \ - "${{ inputs.working-directory }}" + "${{ inputs.working-directory }}" \ + "${{ steps.php.outputs.path }}" \ + "${{ steps.composer.outputs.command }}" diff --git a/bin/cache_key.sh b/bin/cache_key.sh index 265df0e..e1fc9c2 100755 --- a/bin/cache_key.sh +++ b/bin/cache_key.sh @@ -6,6 +6,7 @@ dependency_versions="${3:-locked}" composer_options="${4}" files_hash="${5}" custom_cache_key="${6}" +working_directory="${7}" key=() restore_key=() @@ -20,12 +21,16 @@ function join_by { if [ -n "${custom_cache_key}" ]; then key+=("${custom_cache_key}") else - key+=("${runner_os}" "php" "${php_version}" "composer") + key+=( + "${runner_os}" + "php" + "${php_version}" + "composer" + "${composer_options}" + "${dependency_versions}" + "${working_directory}" + ) - key+=("${dependency_versions}") - restore_key=("$(join_by - ${key[@]/#/})-" "${restore_key[@]}") - - key+=("${composer_options}") restore_key=("$(join_by - ${key[@]/#/})-" "${restore_key[@]}") key+=("${files_hash}") diff --git a/bin/composer_cache_dir.sh b/bin/composer_cache_dir.sh deleted file mode 100755 index 2101bff..0000000 --- a/bin/composer_cache_dir.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -cache_dir="$(composer config cache-dir)" - -echo "::notice title=Composer Cache::Composer cache directory found at '${cache_dir}'" -echo "::set-output name=directory::${cache_dir}" diff --git a/bin/composer_install.sh b/bin/composer_install.sh index 9d13607..f227aaa 100755 --- a/bin/composer_install.sh +++ b/bin/composer_install.sh @@ -3,6 +3,8 @@ dependency_versions="${1:-locked}" additional_composer_options="${2}" working_directory="${3}" +php_path="${4:-$(which php)}" +composer_path="${5:-$(which composer)}" composer_command="update" composer_options=( @@ -29,4 +31,4 @@ if [ -n "${working_directory}" ]; then fi echo "::notice title=Composer::Using the following Composer command: 'composer ${composer_command} ${composer_options[*]}'" -composer "${composer_command}" ${composer_options[*]} +"${php_path}" "${composer_path}" "${composer_command}" ${composer_options[*]} diff --git a/bin/composer_paths.sh b/bin/composer_paths.sh new file mode 100755 index 0000000..955b28c --- /dev/null +++ b/bin/composer_paths.sh @@ -0,0 +1,62 @@ +#!/usr/bin/env bash + +composer_path="${1:-$(which composer)}" +working_directory="${2:-.}" +php_path="${3:-$(which php)}" + +function test_composer { + "${php_path}" "${composer_path}" --version > /dev/null 2>&1 +} + +function validate_composer { + "${php_path}" "${composer_path}" \ + validate \ + --no-check-publish \ + --no-check-version \ + --working-dir "${working_directory}" \ + > /dev/null 2>&1 +} + +if ! test_composer; then + echo "::error title=Composer Not Found::Unable to find Composer at '${composer_path}'" + exit 1 +fi + +composer_json="composer.json" +composer_lock="composer.lock" + +if [ -n "${working_directory}" ]; then + if [ ! -d "${working_directory}" ]; then + echo "::error title=Working Directory Not Found::Unable to find working directory at '${working_directory}'" + exit 1 + fi + + composer_json="${working_directory}/composer.json" + composer_lock="${working_directory}/composer.lock" +fi + +if [ ! -f "${composer_json}" ]; then + echo "::error title=composer.json Not Found::Unable to find composer.json at '${composer_json}'" + exit 1 +fi + +if ! validate_composer; then + echo "::error title=Invalid composer.json::The composer.json file at '${composer_json}' does not validate; run 'composer validate' to check for errors" + exit 1 +fi + +if [ ! -f "${composer_lock}" ]; then + echo "::notice title=composer.lock Not Found::Unable to find composer.lock at '${composer_lock}'" + composer_lock="" +fi + +cache_dir="$($composer_path config cache-dir)" + +echo "::notice title=Composer Path::Composer path is '${composer_path}'" +echo "::notice title=Composer Cache::Composer cache directory found at '${cache_dir}'" +echo "::notice title=composer.json::File composer.json found at '${composer_json}'" +echo "::notice title=composer.lock::File composer.lock path computed as '${composer_lock}'" +echo "::set-output name=command::${composer_path}" +echo "::set-output name=cache-dir::${cache_dir}" +echo "::set-output name=json::${composer_json}" +echo "::set-output name=lock::${composer_lock}" diff --git a/bin/php_version.sh b/bin/php_version.sh index 37efe10..baca5df 100755 --- a/bin/php_version.sh +++ b/bin/php_version.sh @@ -1,6 +1,20 @@ #!/usr/bin/env bash -php_version=$(php -r 'echo phpversion();') +php_path="${1:-$(which php)}" +# Test PHP command. +function test_php { + $php_path -v > /dev/null 2>&1 +} + +if ! test_php; then + echo "::error title=PHP Not Found::Unable to find PHP at '${php_path}'" + exit 1 +fi + +php_version=$($php_path -r 'echo phpversion();') + +echo "::notice title=PHP Path::PHP path is '${php_path}'" echo "::notice title=PHP Version::PHP version is '${php_version}'" -echo "::set-output name=php::${php_version}" +echo "::set-output name=path::${php_path}" +echo "::set-output name=version::${php_version}" diff --git a/subdirectory/composer.json b/subdirectory/composer.json deleted file mode 100644 index 8685f53..0000000 --- a/subdirectory/composer.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "ramsey/composer-install-subdirectory-test", - "description": "This tests installation using working-directory with this GitHub Action.", - "license": "MIT", - "authors": [ - { - "name": "Ben Ramsey", - "email": "ben@benramsey.com" - } - ], - "require": { - "symfony/console": "^6.0" - } -} diff --git a/subdirectory/composer.lock b/subdirectory/composer.lock deleted file mode 100644 index c1d2bbf..0000000 --- a/subdirectory/composer.lock +++ /dev/null @@ -1,658 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "3cf52742530c60277dd438164085d489", - "packages": [ - { - "name": "psr/container", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" - }, - "time": "2021-11-05T16:47:00+00:00" - }, - { - "name": "symfony/console", - "version": "v6.0.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "fafd9802d386bf1c267e0249ddb7ceb14dcfdad4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/fafd9802d386bf1c267e0249ddb7ceb14dcfdad4", - "reference": "fafd9802d386bf1c267e0249ddb7ceb14dcfdad4", - "shasum": "" - }, - "require": { - "php": ">=8.0.2", - "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.4|^6.0" - }, - "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0|3.0" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/lock": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command line", - "console", - "terminal" - ], - "support": { - "source": "https://github.com/symfony/console/tree/v6.0.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-12-09T12:47:37+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.23.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "reference": "46cd95797e9df938fdd2b03693b5fca5e64b01ce", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.23.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-02-19T12:13:01+00:00" - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.23.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "16880ba9c5ebe3642d1995ab866db29270b36535" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/16880ba9c5ebe3642d1995ab866db29270b36535", - "reference": "16880ba9c5ebe3642d1995ab866db29270b36535", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's grapheme_* functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.23.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-05-27T12:26:48+00:00" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.23.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8590a5f561694770bdcd3f9b5c69dde6945028e8", - "reference": "8590a5f561694770bdcd3f9b5c69dde6945028e8", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.23.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-02-19T12:13:01+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.23.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9174a3d80210dca8daa7f31fec659150bbeabfc6", - "reference": "9174a3d80210dca8daa7f31fec659150bbeabfc6", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.23-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.23.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-05-27T12:26:48+00:00" - }, - { - "name": "symfony/service-contracts", - "version": "v3.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "36715ebf9fb9db73db0cb24263c79077c6fe8603" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/36715ebf9fb9db73db0cb24263c79077c6fe8603", - "reference": "36715ebf9fb9db73db0cb24263c79077c6fe8603", - "shasum": "" - }, - "require": { - "php": ">=8.0.2", - "psr/container": "^2.0" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "suggest": { - "symfony/service-implementation": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.0-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.0.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-11-04T17:53:12+00:00" - }, - { - "name": "symfony/string", - "version": "v6.0.1", - "source": { - "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "0cfed595758ec6e0a25591bdc8ca733c1896af32" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/0cfed595758ec6e0a25591bdc8ca733c1896af32", - "reference": "0cfed595758ec6e0a25591bdc8ca733c1896af32", - "shasum": "" - }, - "require": { - "php": ">=8.0.2", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/translation-contracts": "<2.0" - }, - "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/translation-contracts": "^2.0|^3.0", - "symfony/var-exporter": "^5.4|^6.0" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\String\\": "" - }, - "files": [ - "Resources/functions.php" - ], - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "homepage": "https://symfony.com", - "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" - ], - "support": { - "source": "https://github.com/symfony/string/tree/v6.0.1" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2021-12-08T15:13:44+00:00" - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": [], - "platform-dev": [], - "plugin-api-version": "2.1.0" -} diff --git a/tests/expect/cache_key_04.exp b/tests/expect/cache_key_04.exp index ba1955c..bbe9f56 100755 --- a/tests/expect/cache_key_04.exp +++ b/tests/expect/cache_key_04.exp @@ -8,9 +8,9 @@ set timeout 3 spawn ../../bin/cache_key.sh "Linux" "8.1.1" "lowest" "--ignore-platform-reqs --optimize-autoloader" "long-files-hash" match_max 100000 -expect -exact "::notice title=Primary Cache Key::Cache primary key is 'Linux-php-8.1.1-composer-lowest---ignore-platform-reqs---optimize-autoloader-long-files-hash'" -expect -exact "::notice title=Restore Cache Keys::Cache restore keys are 'Linux-php-8.1.1-composer-lowest---ignore-platform-reqs---optimize-autoloader-, Linux-php-8.1.1-composer-lowest-'" -expect -exact "::set-output name=key::Linux-php-8.1.1-composer-lowest---ignore-platform-reqs---optimize-autoloader-long-files-hash" +expect -exact "::notice title=Primary Cache Key::Cache primary key is 'Linux-php-8.1.1-composer---ignore-platform-reqs---optimize-autoloader-lowest-long-files-hash'" +expect -exact "::notice title=Restore Cache Keys::Cache restore keys are 'Linux-php-8.1.1-composer---ignore-platform-reqs---optimize-autoloader-lowest-'" +expect -exact "::set-output name=key::Linux-php-8.1.1-composer---ignore-platform-reqs---optimize-autoloader-lowest-long-files-hash" expect eof set fp [open $gitHubEnvFile r] @@ -18,8 +18,7 @@ set fileData [read $fp] close $fp set expectedValue "CACHE_RESTORE_KEY<