Compare commits

...

5 Commits

Author SHA1 Message Date
0f7f1d08e3 Upgrade to Jest 30 2025-06-13 02:06:31 +05:30
433bdeeaf0 Bump version to 2.34.1 2025-06-12 03:52:26 +05:30
1c5378302c Update node.js dependencies 2025-06-11 15:17:10 +05:30
c251c791ff Fix pipe in get_sha256 2025-06-11 15:00:38 +05:30
36fada6981 Fix tool-cache directory on self-hosted runners 2025-06-11 14:57:09 +05:30
7 changed files with 4359 additions and 839 deletions

5166
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "setup-php",
"version": "2.34.0",
"version": "2.34.1",
"private": false,
"description": "Setup PHP for use with GitHub Actions",
"main": "lib/install.js",
@ -40,25 +40,25 @@
"compare-versions": "^6.1.1"
},
"devDependencies": {
"@eslint/compat": "^1.2.9",
"@eslint/compat": "^1.3.0",
"@eslint/js": "9.28.0",
"@types/jest": "^29.5.14",
"@types/node": "^22.15.30",
"@typescript-eslint/eslint-plugin": "^8.33.1",
"@typescript-eslint/parser": "^8.33.1",
"@types/node": "^24.0.1",
"@typescript-eslint/eslint-plugin": "^8.34.0",
"@typescript-eslint/parser": "^8.34.0",
"@vercel/ncc": "^0.38.3",
"eslint": "9.28.0",
"eslint-config-prettier": "^10.1.5",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest": "^28.13.0",
"eslint-plugin-jest": "^28.13.3",
"eslint-plugin-prettier": "^5.4.1",
"globals": "^16.2.0",
"jest": "^29.7.0",
"jest-circus": "^29.7.0",
"jest": "^30.0.0",
"jest-circus": "^30.0.0",
"nock": "^14.0.5",
"prettier": "^3.5.3",
"simple-git-hooks": "^2.13.0",
"ts-jest": "^29.3.4",
"ts-jest": "^29.4.0",
"typescript": "^5.8.3"
},
"bugs": {

View File

@ -212,7 +212,7 @@ get_scan_dir() {
# Function to handle self-hosted runner setup.
self_hosted_helper() {
:
sudo mkdir -p /opt/hostedtoolcache >/dev/null 2>&1 || true
}
# Function to Setup PHP.

View File

@ -20,6 +20,7 @@ self_hosted_helper() {
sudo ln -sf /usr/bin/apt-get /usr/bin/apt-fast
trap "sudo rm -f /usr/bin/apt-fast 2>/dev/null" exit
fi
sudo mkdir -p /opt/hostedtoolcache >/dev/null 2>&1 || true
install_packages apt-transport-https ca-certificates curl file make jq unzip autoconf automake gcc g++ gnupg
}

View File

@ -110,11 +110,11 @@ release_lock() {
# Function to get the SHA256 hash of a string.
get_sha256() {
local input=$1
if command -v sha256sum >/dev/null 2>&1; then
if command -v sha256sum >/dev/null; then
printf '%s' "$input" | sha256sum | cut -d' ' -f1
elif command -v shasum >/dev/null 2>&1; then
elif command -v shasum >/dev/null; then
printf '%s' "$input" | shasum -a 256 | cut -d' ' -f1
elif command -v openssl >/dev/null 2>&1; then
elif command -v openssl >/dev/null; then
printf '%s' "$input" | openssl dgst -sha256 | cut -d' ' -f2
fi
}
@ -221,7 +221,7 @@ self_hosted_setup() {
exit 1
else
self_hosted_helper >/dev/null 2>&1
add_env RUNNER_TOOL_CACHE /tmp
add_env RUNNER_TOOL_CACHE /opt/hostedtoolcache
fi
fi
}

View File

@ -419,6 +419,7 @@ export async function addPhive(data: RS): Promise<string> {
* @param data
*/
export async function addPHPUnitTools(data: RS): Promise<string> {
/* istanbul ignore next */
if (data['version'] === 'latest') {
data['version'] =
(await packagist.search(data['packagist'], data['php_version'])) ??

View File

@ -456,6 +456,7 @@ export async function readPHPVersion(): Promise<string> {
const composerLock = path.join(composerProjectDir, 'composer.lock');
if (fs.existsSync(composerLock)) {
const lockFileContents = JSON.parse(fs.readFileSync(composerLock, 'utf8'));
/* istanbul ignore next */
if (
lockFileContents['platform-overrides'] &&
lockFileContents['platform-overrides']['php']
@ -469,6 +470,7 @@ export async function readPHPVersion(): Promise<string> {
const composerFileContents = JSON.parse(
fs.readFileSync(composerJson, 'utf8')
);
/* istanbul ignore next */
if (
composerFileContents['config'] &&
composerFileContents['config']['platform'] &&