From 2da85f306ff33ada806288b5739f5b9376437186 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Sat, 19 Dec 2020 18:47:19 +0530 Subject: [PATCH] Add support for specifying ICU version on PHP 8.0 --- README.md | 4 ++-- __tests__/extensions.test.ts | 3 +++ dist/index.js | 2 +- src/extensions.ts | 4 +--- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8b32ea29..bbb26100 100644 --- a/README.md +++ b/README.md @@ -163,14 +163,14 @@ PHP extensions can be setup using the `extensions` input. It accepts a `string` extensions: :opcache ``` -- Extension `intl` can be setup with specific `ICU` version for `PHP 5.6` to `PHP 7.4` in `Ubuntu` workflows by suffixing `intl` with the `ICU` version. `ICU 50.2` and newer versions are supported. Refer to [`ICU builds`](https://github.com/shivammathur/icu-intl#icu4c-builds) for the specific versions supported. +- Extension `intl` can be setup with specific `ICU` version for `PHP 5.6` to `PHP 8.0` in `Ubuntu` workflows by suffixing `intl` with the `ICU` version. `ICU 50.2` and newer versions are supported. Refer to [`ICU builds`](https://github.com/shivammathur/icu-intl#icu4c-builds) for the specific versions supported. ```yaml - name: Setup PHP with intl uses: shivammathur/setup-php@v2 with: php-version: '7.4' - extensions: intl-67.1 + extensions: intl-68.2 ``` - Extensions loaded by default after `setup-php` runs can be found on the [wiki](https://github.com/shivammathur/setup-php/wiki). diff --git a/__tests__/extensions.test.ts b/__tests__/extensions.test.ts index 371f2f0f..13aac874 100644 --- a/__tests__/extensions.test.ts +++ b/__tests__/extensions.test.ts @@ -130,6 +130,9 @@ describe('Extension tests', () => { linux = await extensions.addExtension('intl-67.1', '7.3', 'linux'); expect(linux).toContain('add_intl intl-67.1'); + + linux = await extensions.addExtension('intl-68.2', '8.0', 'linux'); + expect(linux).toContain('add_intl intl-68.2'); }); it('checking addExtensionOnDarwin', async () => { diff --git a/dist/index.js b/dist/index.js index 75c37c1e..3029e2d4 100644 --- a/dist/index.js +++ b/dist/index.js @@ -3032,7 +3032,7 @@ async function addExtensionLinux(extension_csv, version) { case /^(5\.[3-6]|7\.[0-4]|8\.0)blackfire(-\d+\.\d+\.\d+)?$/.test(version_extension): case /^((5\.[3-6])|(7\.[0-2]))pdo_cubrid$|^((5\.[3-6])|(7\.[0-4]))cubrid$/.test(version_extension): case /^pdo_oci$|^oci8$/.test(extension): - case /^5\.6intl-[\d]+\.[\d]+$|^7\.[0-4]intl-[\d]+\.[\d]+$/.test(version_extension): + case /^(5\.6|7\.[0-4]|8\.0)intl-[\d]+\.[\d]+$/.test(version_extension): case /^(5\.[3-6]|7\.[0-4])(ioncube|geos)$/.test(version_extension): case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension): case /^((5\.6)|(7\.[0-4]))(gearman|couchbase)$/.test(version_extension): diff --git a/src/extensions.ts b/src/extensions.ts index 20f60007..fa0e262e 100644 --- a/src/extensions.ts +++ b/src/extensions.ts @@ -236,9 +236,7 @@ export async function addExtensionLinux( version_extension ): case /^pdo_oci$|^oci8$/.test(extension): - case /^5\.6intl-[\d]+\.[\d]+$|^7\.[0-4]intl-[\d]+\.[\d]+$/.test( - version_extension - ): + case /^(5\.6|7\.[0-4]|8\.0)intl-[\d]+\.[\d]+$/.test(version_extension): case /^(5\.[3-6]|7\.[0-4])(ioncube|geos)$/.test(version_extension): case /^7\.[0-3]phalcon3$|^7\.[2-4]phalcon4$/.test(version_extension): case /^((5\.6)|(7\.[0-4]))(gearman|couchbase)$/.test(version_extension):