Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1b7b26deeb | ||
|
|
0487f686e2 | ||
|
|
f5a7bad686 | ||
|
|
d48014e2bb | ||
|
|
3809746e7d | ||
|
|
f55a0043ab |
21
README.md
21
README.md
@@ -3,8 +3,8 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://github.com/shivammathur/cache-extensions" title="Cache PHP extensions in GitHub Actions"><img alt="GitHub Actions status" src="https://github.com/shivammathur/cache-extensions/workflows/Main%20workflow/badge.svg"></a>
|
<a href="https://github.com/shivammathur/cache-extensions" title="Cache PHP extensions in GitHub Actions"><img alt="GitHub Actions status" src="https://github.com/shivammathur/cache-extensions/workflows/Main%20workflow/badge.svg"></a>
|
||||||
<a href="https://codecov.io/gh/shivammathur/cache-extensions" title="Code coverage"><img alt="Codecov Code Coverage" src="https://codecov.io/gh/shivammathur/cache-extensions/branch/master/graph/badge.svg"></a>
|
<a href="https://codecov.io/gh/shivammathur/cache-extensions" title="Code coverage"><img alt="Codecov Code Coverage" src="https://codecov.io/gh/shivammathur/cache-extensions/branch/master/graph/badge.svg"></a>
|
||||||
<a href="https://github.com/shivammathur/cache-extensions/blob/master/LICENSE" title="license"><img alt="LICENSE" src="https://img.shields.io/badge/license-MIT-428f7e.svg"></a>
|
<a href="https://github.com/shivammathur/cache-extensions/blob/master/LICENSE" title="license"><img alt="LICENSE" src="https://img.shields.io/badge/license-MIT-428f7e.svg?logo=open%20source%20initiative&logoColor=white&labelColor=555555"></a>
|
||||||
<a href="#tada-php-support" title="PHP Versions Supported"><img alt="PHP Versions Supported" src="https://img.shields.io/badge/php-%3E%3D%205.3-8892BF.svg"></a>
|
<a href="#tada-php-support" title="PHP Versions Supported"><img alt="PHP Versions Supported" src="https://img.shields.io/badge/php-5.3%20to%208.1-777bb3.svg?logo=php&logoColor=white&labelColor=555555"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
Cache PHP extensions in [GitHub Actions](https://github.com/features/actions "GitHub Actions"). This action has to be used along with [shivammathur/setup-php](https://github.com/shivammathur/setup-php "Setup PHP") and [actions/cache](https://github.com/actions/cache "Cache in GitHub Actions") GitHub Actions. It configures the environment required to cache PHP extensions. Refer to [Usage](#memo-usage "How to use this") section to see how to use this.
|
Cache PHP extensions in [GitHub Actions](https://github.com/features/actions "GitHub Actions"). This action has to be used along with [shivammathur/setup-php](https://github.com/shivammathur/setup-php "Setup PHP") and [actions/cache](https://github.com/actions/cache "Cache in GitHub Actions") GitHub Actions. It configures the environment required to cache PHP extensions. Refer to [Usage](#memo-usage "How to use this") section to see how to use this.
|
||||||
@@ -32,10 +32,11 @@ Cache PHP extensions in [GitHub Actions](https://github.com/features/actions "Gi
|
|||||||
|5.6|`Stable`|`End of life`|
|
|5.6|`Stable`|`End of life`|
|
||||||
|7.0|`Stable`|`End of life`|
|
|7.0|`Stable`|`End of life`|
|
||||||
|7.1|`Stable`|`End of life`|
|
|7.1|`Stable`|`End of life`|
|
||||||
|7.2|`Stable`|`Security fixes only`|
|
|7.2|`Stable`|`End of life`|
|
||||||
|7.3|`Stable`|`Active`|
|
|7.3|`Stable`|`Security fixes only`|
|
||||||
|7.4|`Stable`|`Active`|
|
|7.4|`Stable`|`Active`|
|
||||||
|8.0|`Nightly`|`In development`|
|
|8.0|`Stable`|`Active`|
|
||||||
|
|8.1|`Nightly`|`In development`|
|
||||||
|
|
||||||
## :cloud: OS/Platform Support
|
## :cloud: OS/Platform Support
|
||||||
|
|
||||||
@@ -46,16 +47,17 @@ Cache PHP extensions in [GitHub Actions](https://github.com/features/actions "Gi
|
|||||||
|Ubuntu 18.04|`ubuntu-latest` or `ubuntu-18.04`|
|
|Ubuntu 18.04|`ubuntu-latest` or `ubuntu-18.04`|
|
||||||
|Ubuntu 16.04|`ubuntu-16.04`|
|
|Ubuntu 16.04|`ubuntu-16.04`|
|
||||||
|macOS Catalina 10.15|`macos-latest` or `macOS-10.15`|
|
|macOS Catalina 10.15|`macos-latest` or `macOS-10.15`|
|
||||||
|
|macOS Big Sur 11.0|`macOS-11.0`|
|
||||||
|
|
||||||
## :memo: Usage
|
## :memo: Usage
|
||||||
|
|
||||||
Use this GitHub Action when the extensions you are adding in [setup-php](https://github.com/shivammathur/setup-php "setup-php GitHub Action") are installed and take a long time to setup. If you are using extensions which have the result `Installed and enabled` in the logs like `pecl` extensions on `Ubuntu` or extensions which have custom support, it is recommended to use this action to cache your extensions.
|
Use this GitHub Action when the extensions you are adding in [setup-php](https://github.com/shivammathur/setup-php "setup-php GitHub Action") are installed and take a long time to set up. If you are using extensions which have the result `Installed and enabled` in the logs like `pecl` extensions on `Ubuntu` or extensions which have custom support, it is recommended to use this action to cache your extensions.
|
||||||
|
|
||||||
### Inputs
|
### Inputs
|
||||||
|
|
||||||
#### `php-version` (required)
|
#### `php-version` (required)
|
||||||
|
|
||||||
- Specify the PHP version you want to setup.
|
- Specify the PHP version you want to set up.
|
||||||
- Accepts a `string`. For example `'7.4'`.
|
- Accepts a `string`. For example `'7.4'`.
|
||||||
- See [PHP support](#tada-php-support) for supported PHP versions.
|
- See [PHP support](#tada-php-support) for supported PHP versions.
|
||||||
|
|
||||||
@@ -117,7 +119,7 @@ jobs:
|
|||||||
|
|
||||||
### Thread Safe Setup
|
### Thread Safe Setup
|
||||||
|
|
||||||
If you setup both `TS` and `NTS` PHP versions on `Windows` in your workflow, please add `${{ env.phpts }}` to `key` and `restore-keys` inputs in `actions/cache` step in the above workflow to avoid conflicting cache.
|
If you set up both `TS` and `NTS` PHP versions on `Windows` in your workflow, please add `${{ env.phpts }}` to `key` and `restore-keys` inputs in `actions/cache` step in the above workflow to avoid a conflicting cache.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Cache extensions
|
- name: Cache extensions
|
||||||
@@ -130,7 +132,7 @@ If you setup both `TS` and `NTS` PHP versions on `Windows` in your workflow, ple
|
|||||||
|
|
||||||
## :scroll: License
|
## :scroll: License
|
||||||
|
|
||||||
The scripts and documentation in this project are released under the [MIT License](LICENSE "License for shivammathur/cache-extensions"). This project has multiple [dependencies](https://github.com/shivammathur/cache-extensions/network/dependencies "Dependencies for this PHP Action"). Their licenses can be found in their respective repositories.
|
The scripts and documentation in this project are under the [MIT License](LICENSE "License for shivammathur/cache-extensions"). This project has multiple [dependencies](https://github.com/shivammathur/cache-extensions/network/dependencies "Dependencies for this PHP Action"). Their licenses can be found in their respective repositories.
|
||||||
|
|
||||||
## :+1: Contributions
|
## :+1: Contributions
|
||||||
|
|
||||||
@@ -144,7 +146,6 @@ If this action helped you.
|
|||||||
- Please consider supporting our work by sponsoring using [Open Collective](https://opencollective.com/setup-php), [Paypal](https://www.paypal.me/shivammathur "Shivam Mathur PayPal") or [Patreon](https://www.patreon.com/shivammathur "Shivam Mathur Patreon").
|
- Please consider supporting our work by sponsoring using [Open Collective](https://opencollective.com/setup-php), [Paypal](https://www.paypal.me/shivammathur "Shivam Mathur PayPal") or [Patreon](https://www.patreon.com/shivammathur "Shivam Mathur Patreon").
|
||||||
- If you use this action at your company, please [reach out](mailto:contact@setup-php.com) to sponsor the project.
|
- If you use this action at your company, please [reach out](mailto:contact@setup-php.com) to sponsor the project.
|
||||||
|
|
||||||
|
|
||||||
## :package: Dependencies
|
## :package: Dependencies
|
||||||
|
|
||||||
- [Node.js dependencies](https://github.com/shivammathur/setup-php/network/dependencies "Node.js dependencies")
|
- [Node.js dependencies](https://github.com/shivammathur/setup-php/network/dependencies "Node.js dependencies")
|
||||||
@@ -7,15 +7,28 @@ jest.mock('@actions/core', () => ({
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
describe('Utils tests', () => {
|
describe('Utils tests', () => {
|
||||||
|
it('checking readEnv', async () => {
|
||||||
|
process.env['test'] = 'setup-php';
|
||||||
|
expect(await utils.readEnv('test')).toBe('setup-php');
|
||||||
|
expect(await utils.readEnv('undefined')).toBe('');
|
||||||
|
});
|
||||||
|
|
||||||
it('checking getInput', async () => {
|
it('checking getInput', async () => {
|
||||||
process.env['test'] = 'cache-extensions';
|
process.env['test'] = 'setup-php';
|
||||||
process.env['undefined'] = '';
|
expect(await utils.getInput('test', false)).toBe('setup-php');
|
||||||
expect(await utils.getInput('test', false)).toBe('cache-extensions');
|
|
||||||
expect(await utils.getInput('undefined', false)).toBe('');
|
|
||||||
expect(await utils.getInput('cache-extensions', false)).toBe(
|
expect(await utils.getInput('cache-extensions', false)).toBe(
|
||||||
'cache-extensions'
|
'cache-extensions'
|
||||||
);
|
);
|
||||||
expect(await utils.getInput('DoesNotExist', false)).toBe('');
|
expect(await utils.getInput('DoesNotExist', false)).toBe('');
|
||||||
|
expect(async () => {
|
||||||
|
await utils.getInput('DoesNotExist', true);
|
||||||
|
}).rejects.toThrow('Input required and not supplied: DoesNotExist');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('checking parseVersion', async () => {
|
||||||
|
expect(await utils.parseVersion('7')).toBe('7.0');
|
||||||
|
expect(await utils.parseVersion('7.4')).toBe('7.4');
|
||||||
|
expect(await utils.parseVersion('latest')).toBe('7.4');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('checking filterExtensions', async () => {
|
it('checking filterExtensions', async () => {
|
||||||
|
|||||||
55
dist/index.js
vendored
55
dist/index.js
vendored
@@ -1054,8 +1054,23 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
exports.filterExtensions = exports.getInput = void 0;
|
exports.filterExtensions = exports.parseVersion = exports.getInput = exports.readEnv = void 0;
|
||||||
const core = __importStar(__webpack_require__(470));
|
const core = __importStar(__webpack_require__(470));
|
||||||
|
/**
|
||||||
|
* Function to read environment variable and return a string value.
|
||||||
|
*
|
||||||
|
* @param property
|
||||||
|
*/
|
||||||
|
async function readEnv(property) {
|
||||||
|
const value = process.env[property];
|
||||||
|
switch (value) {
|
||||||
|
case undefined:
|
||||||
|
return '';
|
||||||
|
default:
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.readEnv = readEnv;
|
||||||
/**
|
/**
|
||||||
* Function to get inputs from both with and env annotations.
|
* Function to get inputs from both with and env annotations.
|
||||||
*
|
*
|
||||||
@@ -1063,16 +1078,39 @@ const core = __importStar(__webpack_require__(470));
|
|||||||
* @param mandatory
|
* @param mandatory
|
||||||
*/
|
*/
|
||||||
async function getInput(name, mandatory) {
|
async function getInput(name, mandatory) {
|
||||||
const input = process.env[name];
|
const input = core.getInput(name);
|
||||||
switch (input) {
|
const env_input = await readEnv(name);
|
||||||
case '':
|
switch (true) {
|
||||||
case undefined:
|
case input != '':
|
||||||
return core.getInput(name, { required: mandatory });
|
|
||||||
default:
|
|
||||||
return input;
|
return input;
|
||||||
|
case input == '' && env_input != '':
|
||||||
|
return env_input;
|
||||||
|
case input == '' && env_input == '' && mandatory:
|
||||||
|
throw new Error(`Input required and not supplied: ${name}`);
|
||||||
|
default:
|
||||||
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.getInput = getInput;
|
exports.getInput = getInput;
|
||||||
|
/**
|
||||||
|
* Function to parse PHP version.
|
||||||
|
*
|
||||||
|
* @param version
|
||||||
|
*/
|
||||||
|
async function parseVersion(version) {
|
||||||
|
switch (version) {
|
||||||
|
case 'latest':
|
||||||
|
return '7.4';
|
||||||
|
default:
|
||||||
|
switch (true) {
|
||||||
|
case version.length > 1:
|
||||||
|
return version.slice(0, 3);
|
||||||
|
default:
|
||||||
|
return version + '.0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.parseVersion = parseVersion;
|
||||||
/**
|
/**
|
||||||
* Function to filter extensions
|
* Function to filter extensions
|
||||||
*
|
*
|
||||||
@@ -1687,8 +1725,7 @@ const utils = __importStar(__webpack_require__(163));
|
|||||||
*/
|
*/
|
||||||
async function run() {
|
async function run() {
|
||||||
try {
|
try {
|
||||||
let version = await utils.getInput('php-version', true);
|
const version = await utils.parseVersion(await utils.getInput('php-version', true));
|
||||||
version = version.length > 1 ? version.slice(0, 3) : version + '.0';
|
|
||||||
const extensions = await utils.filterExtensions(await utils.getInput('extensions', true));
|
const extensions = await utils.filterExtensions(await utils.getInput('extensions', true));
|
||||||
const key = await utils.getInput('key', true);
|
const key = await utils.getInput('key', true);
|
||||||
const script_path = path.join(__dirname, '../src/extensions.sh');
|
const script_path = path.join(__dirname, '../src/extensions.sh');
|
||||||
|
|||||||
2504
package-lock.json
generated
2504
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
26
package.json
26
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cache-extensions",
|
"name": "cache-extensions",
|
||||||
"version": "1.2.0",
|
"version": "1.3.2",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "Cache extensions in GitHub Actions",
|
"description": "Cache extensions in GitHub Actions",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
@@ -28,22 +28,22 @@
|
|||||||
"@actions/exec": "^1.0.4"
|
"@actions/exec": "^1.0.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^26.0.14",
|
"@types/jest": "^26.0.15",
|
||||||
"@types/node": "^14.11.2",
|
"@types/node": "^14.14.10",
|
||||||
"@typescript-eslint/eslint-plugin": "^4.3.0",
|
"@typescript-eslint/eslint-plugin": "^4.8.2",
|
||||||
"@typescript-eslint/parser": "^4.3.0",
|
"@typescript-eslint/parser": "^4.8.2",
|
||||||
"@zeit/ncc": "^0.22.3",
|
"@zeit/ncc": "^0.22.3",
|
||||||
"eslint": "^7.10.0",
|
"eslint": "^7.14.0",
|
||||||
"eslint-config-prettier": "^6.12.0",
|
"eslint-config-prettier": "^6.15.0",
|
||||||
"eslint-plugin-import": "^2.22.1",
|
"eslint-plugin-import": "^2.22.1",
|
||||||
"eslint-plugin-jest": "^24.0.2",
|
"eslint-plugin-jest": "^24.1.3",
|
||||||
"eslint-plugin-prettier": "^3.1.4",
|
"eslint-plugin-prettier": "^3.1.4",
|
||||||
"husky": "^4.3.0",
|
"husky": "^4.3.0",
|
||||||
"jest": "^26.4.2",
|
"jest": "^26.6.3",
|
||||||
"jest-circus": "^26.4.2",
|
"jest-circus": "^26.6.3",
|
||||||
"prettier": "^2.1.2",
|
"prettier": "^2.2.0",
|
||||||
"ts-jest": "^26.4.1",
|
"ts-jest": "^26.4.4",
|
||||||
"typescript": "^4.0.3"
|
"typescript": "^4.1.2"
|
||||||
},
|
},
|
||||||
"husky": {
|
"husky": {
|
||||||
"skipCI": true,
|
"skipCI": true,
|
||||||
|
|||||||
@@ -8,9 +8,10 @@ import * as utils from './utils';
|
|||||||
*/
|
*/
|
||||||
export async function run(): Promise<void> {
|
export async function run(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
let version: string = await utils.getInput('php-version', true);
|
const version: string = await utils.parseVersion(
|
||||||
version = version.length > 1 ? version.slice(0, 3) : version + '.0';
|
await utils.getInput('php-version', true)
|
||||||
const extensions = await utils.filterExtensions(
|
);
|
||||||
|
const extensions: string = await utils.filterExtensions(
|
||||||
await utils.getInput('extensions', true)
|
await utils.getInput('extensions', true)
|
||||||
);
|
);
|
||||||
const key: string = await utils.getInput('key', true);
|
const key: string = await utils.getInput('key', true);
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
linux_extension_dir() {
|
linux_extension_dir() {
|
||||||
apiv=$1
|
apiv=$1
|
||||||
old_versions_linux="5.[4-5]"
|
|
||||||
if [ "$version" = "5.3" ]; then
|
if [ "$version" = "5.3" ]; then
|
||||||
echo "/home/runner/php/5.3.29/lib/php/extensions/no-debug-non-zts-$apiv"
|
echo "/home/runner/php/5.3.29/lib/php/extensions/no-debug-non-zts-$apiv"
|
||||||
elif [[ "$version" =~ $old_versions_linux ]]; then
|
elif [[ "$version" =~ $old_versions ]]; then
|
||||||
echo "/usr/lib/php5/$apiv"
|
echo "/usr/lib/php5/$apiv"
|
||||||
elif [ "$version" = "8.0" ]; then
|
elif [[ "$version" =~ $nightly_versions ]]; then
|
||||||
echo "/usr/local/php/8.0/lib/php/extensions/no-debug-non-zts-$apiv"
|
echo "/usr/local/php/$version/lib/php/extensions/no-debug-non-zts-$apiv"
|
||||||
else
|
else
|
||||||
echo "/usr/lib/php/$apiv"
|
echo "/usr/lib/php/$apiv"
|
||||||
fi
|
fi
|
||||||
@@ -33,6 +32,7 @@ get_apiv() {
|
|||||||
7.2) echo "20170718" ;;
|
7.2) echo "20170718" ;;
|
||||||
7.3) echo "20180731" ;;
|
7.3) echo "20180731" ;;
|
||||||
7.4) echo "20190902" ;;
|
7.4) echo "20190902" ;;
|
||||||
|
8.0) echo "20200930" ;;
|
||||||
*)
|
*)
|
||||||
php_h="https://raw.githubusercontent.com/php/php-src/master/main/php.h"
|
php_h="https://raw.githubusercontent.com/php/php-src/master/main/php.h"
|
||||||
curl -sSL --retry 5 "$php_h" | grep "PHP_API_VERSION" | cut -d' ' -f 3
|
curl -sSL --retry 5 "$php_h" | grep "PHP_API_VERSION" | cut -d' ' -f 3
|
||||||
@@ -73,6 +73,8 @@ extensions=$1
|
|||||||
key=$2
|
key=$2
|
||||||
version=$3
|
version=$3
|
||||||
os=$(uname -s)
|
os=$(uname -s)
|
||||||
|
old_versions="5.[4-5]"
|
||||||
|
nightly_versions="8.[0-1]"
|
||||||
if [ "$os" = "Linux" ]; then
|
if [ "$os" = "Linux" ]; then
|
||||||
release=$(lsb_release -s -c)
|
release=$(lsb_release -s -c)
|
||||||
os=$os-$release
|
os=$os-$release
|
||||||
@@ -88,9 +90,7 @@ else
|
|||||||
os="Windows"
|
os="Windows"
|
||||||
dir='C:\\tools\\php\\ext'
|
dir='C:\\tools\\php\\ext'
|
||||||
fi
|
fi
|
||||||
if [ "$version" = "8.0" ]; then
|
|
||||||
key="$key-20200930"
|
|
||||||
fi
|
|
||||||
key="$os"-ext-"$version"-$(echo -n "$extensions-$key" | openssl dgst -sha256 | cut -d ' ' -f 2)
|
key="$os"-ext-"$version"-$(echo -n "$extensions-$key" | openssl dgst -sha256 | cut -d ' ' -f 2)
|
||||||
|
key="$key-20201126"
|
||||||
echo "::set-output name=dir::$dir"
|
echo "::set-output name=dir::$dir"
|
||||||
echo "::set-output name=key::$key"
|
echo "::set-output name=key::$key"
|
||||||
@@ -6,8 +6,8 @@ Core
|
|||||||
ctype
|
ctype
|
||||||
curl
|
curl
|
||||||
date
|
date
|
||||||
|
dba
|
||||||
dom
|
dom
|
||||||
enchant
|
|
||||||
exif
|
exif
|
||||||
FFI
|
FFI
|
||||||
fileinfo
|
fileinfo
|
||||||
@@ -21,10 +21,12 @@ iconv
|
|||||||
ioncube
|
ioncube
|
||||||
intl
|
intl
|
||||||
json
|
json
|
||||||
|
ldap
|
||||||
libxml
|
libxml
|
||||||
mbstring
|
mbstring
|
||||||
mysqli
|
mysqli
|
||||||
mysqlnd
|
mysqlnd
|
||||||
|
odbc
|
||||||
openssl
|
openssl
|
||||||
pcntl
|
pcntl
|
||||||
pcov
|
pcov
|
||||||
@@ -32,11 +34,14 @@ pcre
|
|||||||
PDO
|
PDO
|
||||||
oci8
|
oci8
|
||||||
PDO_OCI
|
PDO_OCI
|
||||||
|
pdo_dblib
|
||||||
pdo_mysql
|
pdo_mysql
|
||||||
|
PDO_ODBC
|
||||||
pdo_pgsql
|
pdo_pgsql
|
||||||
pdo_sqlite
|
pdo_sqlite
|
||||||
pgsql
|
pgsql
|
||||||
Phar
|
Phar
|
||||||
|
phpdbg_webhelper
|
||||||
posix
|
posix
|
||||||
pspell
|
pspell
|
||||||
readline
|
readline
|
||||||
@@ -46,6 +51,7 @@ shmop
|
|||||||
SimpleXML
|
SimpleXML
|
||||||
soap
|
soap
|
||||||
sockets
|
sockets
|
||||||
|
sodium
|
||||||
SPL
|
SPL
|
||||||
sqlite3
|
sqlite3
|
||||||
standard
|
standard
|
||||||
@@ -54,9 +60,9 @@ sysvsem
|
|||||||
sysvshm
|
sysvshm
|
||||||
tidy
|
tidy
|
||||||
tokenizer
|
tokenizer
|
||||||
|
xdebug
|
||||||
xml
|
xml
|
||||||
xmlreader
|
xmlreader
|
||||||
xmlrpc
|
|
||||||
xmlwriter
|
xmlwriter
|
||||||
xsl
|
xsl
|
||||||
Zend OPcache
|
Zend OPcache
|
||||||
@@ -69,4 +75,3 @@ blackfire
|
|||||||
[Zend Modules]
|
[Zend Modules]
|
||||||
Zend OPcache
|
Zend OPcache
|
||||||
Xdebug
|
Xdebug
|
||||||
|
|
||||||
|
|||||||
77
src/lists/bionic-php8.1-extensions
Normal file
77
src/lists/bionic-php8.1-extensions
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
[PHP Modules]
|
||||||
|
bcmath
|
||||||
|
bz2
|
||||||
|
calendar
|
||||||
|
Core
|
||||||
|
ctype
|
||||||
|
curl
|
||||||
|
date
|
||||||
|
dba
|
||||||
|
dom
|
||||||
|
exif
|
||||||
|
FFI
|
||||||
|
fileinfo
|
||||||
|
filter
|
||||||
|
ftp
|
||||||
|
gd
|
||||||
|
gettext
|
||||||
|
gmp
|
||||||
|
hash
|
||||||
|
iconv
|
||||||
|
ioncube
|
||||||
|
intl
|
||||||
|
json
|
||||||
|
ldap
|
||||||
|
libxml
|
||||||
|
mbstring
|
||||||
|
mysqli
|
||||||
|
mysqlnd
|
||||||
|
odbc
|
||||||
|
openssl
|
||||||
|
pcntl
|
||||||
|
pcov
|
||||||
|
pcre
|
||||||
|
PDO
|
||||||
|
oci8
|
||||||
|
PDO_OCI
|
||||||
|
pdo_dblib
|
||||||
|
pdo_mysql
|
||||||
|
PDO_ODBC
|
||||||
|
pdo_pgsql
|
||||||
|
pdo_sqlite
|
||||||
|
pgsql
|
||||||
|
Phar
|
||||||
|
phpdbg_webhelper
|
||||||
|
posix
|
||||||
|
pspell
|
||||||
|
readline
|
||||||
|
Reflection
|
||||||
|
session
|
||||||
|
shmop
|
||||||
|
SimpleXML
|
||||||
|
soap
|
||||||
|
sockets
|
||||||
|
sodium
|
||||||
|
SPL
|
||||||
|
sqlite3
|
||||||
|
standard
|
||||||
|
sysvmsg
|
||||||
|
sysvsem
|
||||||
|
sysvshm
|
||||||
|
tidy
|
||||||
|
tokenizer
|
||||||
|
xdebug
|
||||||
|
xml
|
||||||
|
xmlreader
|
||||||
|
xmlwriter
|
||||||
|
xsl
|
||||||
|
Zend OPcache
|
||||||
|
zip
|
||||||
|
zlib
|
||||||
|
phalcon3
|
||||||
|
phalcon4
|
||||||
|
blackfire
|
||||||
|
|
||||||
|
[Zend Modules]
|
||||||
|
Zend OPcache
|
||||||
|
Xdebug
|
||||||
@@ -4,11 +4,10 @@ bz2
|
|||||||
calendar
|
calendar
|
||||||
Core
|
Core
|
||||||
ctype
|
ctype
|
||||||
cubrid
|
|
||||||
curl
|
curl
|
||||||
date
|
date
|
||||||
|
dba
|
||||||
dom
|
dom
|
||||||
enchant
|
|
||||||
exif
|
exif
|
||||||
FFI
|
FFI
|
||||||
fileinfo
|
fileinfo
|
||||||
@@ -22,10 +21,12 @@ iconv
|
|||||||
ioncube
|
ioncube
|
||||||
intl
|
intl
|
||||||
json
|
json
|
||||||
|
ldap
|
||||||
libxml
|
libxml
|
||||||
mbstring
|
mbstring
|
||||||
mysqli
|
mysqli
|
||||||
mysqlnd
|
mysqlnd
|
||||||
|
odbc
|
||||||
openssl
|
openssl
|
||||||
pcntl
|
pcntl
|
||||||
pcov
|
pcov
|
||||||
@@ -33,11 +34,14 @@ pcre
|
|||||||
PDO
|
PDO
|
||||||
oci8
|
oci8
|
||||||
PDO_OCI
|
PDO_OCI
|
||||||
|
pdo_dblib
|
||||||
pdo_mysql
|
pdo_mysql
|
||||||
|
PDO_ODBC
|
||||||
pdo_pgsql
|
pdo_pgsql
|
||||||
pdo_sqlite
|
pdo_sqlite
|
||||||
pgsql
|
pgsql
|
||||||
Phar
|
Phar
|
||||||
|
phpdbg_webhelper
|
||||||
posix
|
posix
|
||||||
pspell
|
pspell
|
||||||
readline
|
readline
|
||||||
@@ -47,6 +51,7 @@ shmop
|
|||||||
SimpleXML
|
SimpleXML
|
||||||
soap
|
soap
|
||||||
sockets
|
sockets
|
||||||
|
sodium
|
||||||
SPL
|
SPL
|
||||||
sqlite3
|
sqlite3
|
||||||
standard
|
standard
|
||||||
@@ -55,9 +60,9 @@ sysvsem
|
|||||||
sysvshm
|
sysvshm
|
||||||
tidy
|
tidy
|
||||||
tokenizer
|
tokenizer
|
||||||
|
xdebug
|
||||||
xml
|
xml
|
||||||
xmlreader
|
xmlreader
|
||||||
xmlrpc
|
|
||||||
xmlwriter
|
xmlwriter
|
||||||
xsl
|
xsl
|
||||||
Zend OPcache
|
Zend OPcache
|
||||||
|
|||||||
77
src/lists/focal-php8.1-extensions
Normal file
77
src/lists/focal-php8.1-extensions
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
[PHP Modules]
|
||||||
|
bcmath
|
||||||
|
bz2
|
||||||
|
calendar
|
||||||
|
Core
|
||||||
|
ctype
|
||||||
|
curl
|
||||||
|
date
|
||||||
|
dba
|
||||||
|
dom
|
||||||
|
exif
|
||||||
|
FFI
|
||||||
|
fileinfo
|
||||||
|
filter
|
||||||
|
ftp
|
||||||
|
gd
|
||||||
|
gettext
|
||||||
|
gmp
|
||||||
|
hash
|
||||||
|
iconv
|
||||||
|
ioncube
|
||||||
|
intl
|
||||||
|
json
|
||||||
|
ldap
|
||||||
|
libxml
|
||||||
|
mbstring
|
||||||
|
mysqli
|
||||||
|
mysqlnd
|
||||||
|
odbc
|
||||||
|
openssl
|
||||||
|
pcntl
|
||||||
|
pcov
|
||||||
|
pcre
|
||||||
|
PDO
|
||||||
|
oci8
|
||||||
|
PDO_OCI
|
||||||
|
pdo_dblib
|
||||||
|
pdo_mysql
|
||||||
|
PDO_ODBC
|
||||||
|
pdo_pgsql
|
||||||
|
pdo_sqlite
|
||||||
|
pgsql
|
||||||
|
Phar
|
||||||
|
phpdbg_webhelper
|
||||||
|
posix
|
||||||
|
pspell
|
||||||
|
readline
|
||||||
|
Reflection
|
||||||
|
session
|
||||||
|
shmop
|
||||||
|
SimpleXML
|
||||||
|
soap
|
||||||
|
sockets
|
||||||
|
sodium
|
||||||
|
SPL
|
||||||
|
sqlite3
|
||||||
|
standard
|
||||||
|
sysvmsg
|
||||||
|
sysvsem
|
||||||
|
sysvshm
|
||||||
|
tidy
|
||||||
|
tokenizer
|
||||||
|
xdebug
|
||||||
|
xml
|
||||||
|
xmlreader
|
||||||
|
xmlwriter
|
||||||
|
xsl
|
||||||
|
Zend OPcache
|
||||||
|
zip
|
||||||
|
zlib
|
||||||
|
phalcon3
|
||||||
|
phalcon4
|
||||||
|
blackfire
|
||||||
|
|
||||||
|
[Zend Modules]
|
||||||
|
Zend OPcache
|
||||||
|
Xdebug
|
||||||
@@ -4,11 +4,10 @@ bz2
|
|||||||
calendar
|
calendar
|
||||||
Core
|
Core
|
||||||
ctype
|
ctype
|
||||||
cubrid
|
|
||||||
curl
|
curl
|
||||||
date
|
date
|
||||||
|
dba
|
||||||
dom
|
dom
|
||||||
enchant
|
|
||||||
exif
|
exif
|
||||||
FFI
|
FFI
|
||||||
fileinfo
|
fileinfo
|
||||||
@@ -22,10 +21,12 @@ iconv
|
|||||||
ioncube
|
ioncube
|
||||||
intl
|
intl
|
||||||
json
|
json
|
||||||
|
ldap
|
||||||
libxml
|
libxml
|
||||||
mbstring
|
mbstring
|
||||||
mysqli
|
mysqli
|
||||||
mysqlnd
|
mysqlnd
|
||||||
|
odbc
|
||||||
openssl
|
openssl
|
||||||
pcntl
|
pcntl
|
||||||
pcov
|
pcov
|
||||||
@@ -33,11 +34,14 @@ pcre
|
|||||||
PDO
|
PDO
|
||||||
oci8
|
oci8
|
||||||
PDO_OCI
|
PDO_OCI
|
||||||
|
pdo_dblib
|
||||||
pdo_mysql
|
pdo_mysql
|
||||||
|
PDO_ODBC
|
||||||
pdo_pgsql
|
pdo_pgsql
|
||||||
pdo_sqlite
|
pdo_sqlite
|
||||||
pgsql
|
pgsql
|
||||||
Phar
|
Phar
|
||||||
|
phpdbg_webhelper
|
||||||
posix
|
posix
|
||||||
pspell
|
pspell
|
||||||
readline
|
readline
|
||||||
@@ -47,6 +51,7 @@ shmop
|
|||||||
SimpleXML
|
SimpleXML
|
||||||
soap
|
soap
|
||||||
sockets
|
sockets
|
||||||
|
sodium
|
||||||
SPL
|
SPL
|
||||||
sqlite3
|
sqlite3
|
||||||
standard
|
standard
|
||||||
@@ -55,9 +60,9 @@ sysvsem
|
|||||||
sysvshm
|
sysvshm
|
||||||
tidy
|
tidy
|
||||||
tokenizer
|
tokenizer
|
||||||
|
xdebug
|
||||||
xml
|
xml
|
||||||
xmlreader
|
xmlreader
|
||||||
xmlrpc
|
|
||||||
xmlwriter
|
xmlwriter
|
||||||
xsl
|
xsl
|
||||||
Zend OPcache
|
Zend OPcache
|
||||||
@@ -70,4 +75,3 @@ blackfire
|
|||||||
[Zend Modules]
|
[Zend Modules]
|
||||||
Zend OPcache
|
Zend OPcache
|
||||||
Xdebug
|
Xdebug
|
||||||
|
|
||||||
|
|||||||
77
src/lists/xenial-php8.1-extensions
Normal file
77
src/lists/xenial-php8.1-extensions
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
[PHP Modules]
|
||||||
|
bcmath
|
||||||
|
bz2
|
||||||
|
calendar
|
||||||
|
Core
|
||||||
|
ctype
|
||||||
|
curl
|
||||||
|
date
|
||||||
|
dba
|
||||||
|
dom
|
||||||
|
exif
|
||||||
|
FFI
|
||||||
|
fileinfo
|
||||||
|
filter
|
||||||
|
ftp
|
||||||
|
gd
|
||||||
|
gettext
|
||||||
|
gmp
|
||||||
|
hash
|
||||||
|
iconv
|
||||||
|
ioncube
|
||||||
|
intl
|
||||||
|
json
|
||||||
|
ldap
|
||||||
|
libxml
|
||||||
|
mbstring
|
||||||
|
mysqli
|
||||||
|
mysqlnd
|
||||||
|
odbc
|
||||||
|
openssl
|
||||||
|
pcntl
|
||||||
|
pcov
|
||||||
|
pcre
|
||||||
|
PDO
|
||||||
|
oci8
|
||||||
|
PDO_OCI
|
||||||
|
pdo_dblib
|
||||||
|
pdo_mysql
|
||||||
|
PDO_ODBC
|
||||||
|
pdo_pgsql
|
||||||
|
pdo_sqlite
|
||||||
|
pgsql
|
||||||
|
Phar
|
||||||
|
phpdbg_webhelper
|
||||||
|
posix
|
||||||
|
pspell
|
||||||
|
readline
|
||||||
|
Reflection
|
||||||
|
session
|
||||||
|
shmop
|
||||||
|
SimpleXML
|
||||||
|
soap
|
||||||
|
sockets
|
||||||
|
sodium
|
||||||
|
SPL
|
||||||
|
sqlite3
|
||||||
|
standard
|
||||||
|
sysvmsg
|
||||||
|
sysvsem
|
||||||
|
sysvshm
|
||||||
|
tidy
|
||||||
|
tokenizer
|
||||||
|
xdebug
|
||||||
|
xml
|
||||||
|
xmlreader
|
||||||
|
xmlwriter
|
||||||
|
xsl
|
||||||
|
Zend OPcache
|
||||||
|
zip
|
||||||
|
zlib
|
||||||
|
phalcon3
|
||||||
|
phalcon4
|
||||||
|
blackfire
|
||||||
|
|
||||||
|
[Zend Modules]
|
||||||
|
Zend OPcache
|
||||||
|
Xdebug
|
||||||
50
src/utils.ts
50
src/utils.ts
@@ -1,6 +1,21 @@
|
|||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to read environment variable and return a string value.
|
||||||
|
*
|
||||||
|
* @param property
|
||||||
|
*/
|
||||||
|
export async function readEnv(property: string): Promise<string> {
|
||||||
|
const value = process.env[property];
|
||||||
|
switch (value) {
|
||||||
|
case undefined:
|
||||||
|
return '';
|
||||||
|
default:
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function to get inputs from both with and env annotations.
|
* Function to get inputs from both with and env annotations.
|
||||||
*
|
*
|
||||||
@@ -11,13 +26,36 @@ export async function getInput(
|
|||||||
name: string,
|
name: string,
|
||||||
mandatory: boolean
|
mandatory: boolean
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
const input = process.env[name];
|
const input = core.getInput(name);
|
||||||
switch (input) {
|
const env_input = await readEnv(name);
|
||||||
case '':
|
switch (true) {
|
||||||
case undefined:
|
case input != '':
|
||||||
return core.getInput(name, {required: mandatory});
|
|
||||||
default:
|
|
||||||
return input;
|
return input;
|
||||||
|
case input == '' && env_input != '':
|
||||||
|
return env_input;
|
||||||
|
case input == '' && env_input == '' && mandatory:
|
||||||
|
throw new Error(`Input required and not supplied: ${name}`);
|
||||||
|
default:
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function to parse PHP version.
|
||||||
|
*
|
||||||
|
* @param version
|
||||||
|
*/
|
||||||
|
export async function parseVersion(version: string): Promise<string> {
|
||||||
|
switch (version) {
|
||||||
|
case 'latest':
|
||||||
|
return '7.4';
|
||||||
|
default:
|
||||||
|
switch (true) {
|
||||||
|
case version.length > 1:
|
||||||
|
return version.slice(0, 3);
|
||||||
|
default:
|
||||||
|
return version + '.0';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user