Compare commits

...

9 Commits

Author SHA1 Message Date
7aefaa0b54 Merge pull request #967 from jrfnl/feature/readme-fix-broken-link
README: fix broken link
2025-06-25 05:04:51 +05:30
048eb79ef3 README: fix broken link 2025-06-25 01:31:29 +02:00
29247235f0 Merge pull request #966 from OskarStark/patch-1
⚙ Improvement: Update docs
2025-06-24 20:41:11 +05:30
e84efebd6e Update docs
As version 2 is the standard right now, make it clear by setting the v1 manually.
2025-06-24 17:39:04 +03:00
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
8 changed files with 4361 additions and 841 deletions

View File

@ -258,7 +258,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
When you specify just the major version or the version in `major.minor` format, the latest patch version matching the input will be setup.
With the exception of major versions of `composer`, if you specify only the `major` version or the version in `major.minor` format for a tool you can get rate limited by GitHub's API. To avoid this, it is recommended to provide a [`GitHub` OAuth token](https://github.com/shivammathur/setup-php#composer-github-oauth "Composer GitHub OAuth").
With the exception of major versions of `composer`, if you specify only the `major` version or the version in `major.minor` format for a tool you can get rate limited by GitHub's API. To avoid this, it is recommended to provide a [`GitHub` OAuth token](https://github.com/shivammathur/setup-php#github-composer-authentication "Composer GitHub OAuth").
You can do that by setting `GITHUB_TOKEN` environment variable. The `COMPOSER_TOKEN` environment variable has been deprecated in favor of `GITHUB_TOKEN` and will be removed in the next major version.
```yaml
@ -278,7 +278,7 @@ These tools can be set up globally using the `tools` input. It accepts a string
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
tools: composer:v2
tools: composer:v1
```
- If you do not use composer in your workflow, you can specify `tools: none` to skip it.

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'] &&