setup-php 1.11.2 → 1.11.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +433 -458
- package/lib/config.d.ts +3 -0
- package/lib/config.js +71 -71
- package/lib/config.js.map +1 -1
- package/lib/coverage.d.ts +4 -0
- package/lib/coverage.js +97 -87
- package/lib/coverage.js.map +1 -1
- package/lib/extensions.d.ts +4 -0
- package/lib/extensions.js +188 -200
- package/lib/extensions.js.map +1 -1
- package/lib/install.d.ts +2 -0
- package/lib/install.js +96 -81
- package/lib/install.js.map +1 -1
- package/lib/tools.d.ts +18 -0
- package/lib/tools.js +306 -386
- package/lib/tools.js.map +1 -1
- package/lib/utils.d.ts +15 -0
- package/lib/utils.js +205 -291
- package/lib/utils.js.map +1 -1
- package/package.json +66 -56
- package/src/config.ts +82 -82
- package/src/configs/brew_extensions +28 -0
- package/src/configs/php-versions.json +5 -5
- package/src/configs/phpunit.json +24 -24
- package/src/coverage.ts +146 -146
- package/src/extensions.ts +235 -233
- package/src/install.ts +104 -104
- package/src/scripts/darwin.sh +341 -339
- package/src/scripts/ext/gearman.sh +22 -22
- package/src/scripts/ext/phalcon.ps1 +55 -55
- package/src/scripts/ext/phalcon.sh +70 -70
- package/src/scripts/linux.sh +361 -361
- package/src/scripts/win32.ps1 +326 -333
- package/src/tools.ts +472 -469
- package/src/utils.ts +319 -316
- package/.eslintrc.json +0 -16
- package/.github/CODE_OF_CONDUCT.md +0 -76
- package/.github/CONTRIBUTING.md +0 -69
- package/.github/FUNDING.yml +0 -7
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -23
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -38
- package/.github/SECURITY.md +0 -29
- package/.github/workflows/main-workflow.yml +0 -56
- package/.github/workflows/node-workflow.yml +0 -47
- package/.idea/workspace.xml +0 -113
- package/.prettierrc.json +0 -12
- package/__tests__/config.test.ts +0 -52
- package/__tests__/coverage.test.ts +0 -110
- package/__tests__/extensions.test.ts +0 -120
- package/__tests__/install.test.ts +0 -181
- package/__tests__/tools.test.ts +0 -476
- package/__tests__/utils.test.ts +0 -213
- package/action.yml +0 -38
- package/dist/index.js +0 -2854
- package/examples/bedrock.yml +0 -32
- package/examples/cakephp-mysql.yml +0 -114
- package/examples/cakephp-postgres.yml +0 -112
- package/examples/cakephp.yml +0 -92
- package/examples/codeigniter.yml +0 -34
- package/examples/laravel-mysql.yml +0 -74
- package/examples/laravel-postgres.yml +0 -74
- package/examples/laravel.yml +0 -42
- package/examples/lumen-mysql.yml +0 -74
- package/examples/lumen-postgres.yml +0 -74
- package/examples/lumen.yml +0 -38
- package/examples/phalcon-mysql.yml +0 -74
- package/examples/phalcon-postgres.yml +0 -73
- package/examples/sage.yml +0 -57
- package/examples/slim-framework.yml +0 -34
- package/examples/symfony-mysql.yml +0 -56
- package/examples/symfony-postgres.yml +0 -54
- package/examples/symfony.yml +0 -39
- package/examples/yii2-mysql.yml +0 -73
- package/examples/yii2-postgres.yml +0 -71
- package/examples/zend-framework.yml +0 -36
- package/jest.config.js +0 -12
- package/lib/sapi.js +0 -64
- package/tsconfig.json +0 -18
package/src/install.ts
CHANGED
|
@@ -1,104 +1,104 @@
|
|
|
1
|
-
import {exec} from '@actions/exec';
|
|
2
|
-
import * as core from '@actions/core';
|
|
3
|
-
import * as config from './config';
|
|
4
|
-
import * as coverage from './coverage';
|
|
5
|
-
import * as extensions from './extensions';
|
|
6
|
-
import * as tools from './tools';
|
|
7
|
-
import * as utils from './utils';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Build the script
|
|
11
|
-
*
|
|
12
|
-
* @param filename
|
|
13
|
-
* @param version
|
|
14
|
-
* @param os_version
|
|
15
|
-
*/
|
|
16
|
-
export async function build(
|
|
17
|
-
filename: string,
|
|
18
|
-
version: string,
|
|
19
|
-
os_version: string
|
|
20
|
-
): Promise<string> {
|
|
21
|
-
// taking inputs
|
|
22
|
-
const name = 'setup-php';
|
|
23
|
-
const url = 'https://setup-php.com/support';
|
|
24
|
-
const extension_csv: string =
|
|
25
|
-
(await utils.getInput('extensions', false)) ||
|
|
26
|
-
(await utils.getInput('extension', false)) ||
|
|
27
|
-
(await utils.getInput('extension-csv', false));
|
|
28
|
-
const ini_values_csv: string =
|
|
29
|
-
(await utils.getInput('ini-values', false)) ||
|
|
30
|
-
(await utils.getInput('ini-values-csv', false));
|
|
31
|
-
const coverage_driver: string = await utils.getInput('coverage', false);
|
|
32
|
-
const tools_csv: string = await utils.getInput('tools', false);
|
|
33
|
-
|
|
34
|
-
let script: string = await utils.readScript(filename);
|
|
35
|
-
script += await tools.addTools(tools_csv, version, os_version);
|
|
36
|
-
|
|
37
|
-
if (extension_csv) {
|
|
38
|
-
script += await extensions.addExtension(extension_csv, version, os_version);
|
|
39
|
-
}
|
|
40
|
-
if (coverage_driver) {
|
|
41
|
-
script += await coverage.addCoverage(coverage_driver, version, os_version);
|
|
42
|
-
}
|
|
43
|
-
if (ini_values_csv) {
|
|
44
|
-
script += await config.addINIValues(ini_values_csv, os_version);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
script += '\n' + (await utils.stepLog('Support this project', os_version));
|
|
48
|
-
script += '\n' + (await utils.addLog('$tick', name, url, os_version));
|
|
49
|
-
|
|
50
|
-
return await utils.writeScript(filename, script);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Run the script
|
|
55
|
-
*/
|
|
56
|
-
export async function run(): Promise<void> {
|
|
57
|
-
try {
|
|
58
|
-
if ((await utils.readEnv('ImageOS')) == 'ubuntu16') {
|
|
59
|
-
core.setFailed(
|
|
60
|
-
'setup-php is not supported on Ubuntu 16.04. Please upgrade to Ubuntu 18.04 or Ubuntu 20.04 - https://setup-php.com/i/452'
|
|
61
|
-
);
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
core.warning(
|
|
65
|
-
'setup-php v1 is deprecated.\nPlease upgrade to v2 - https://setup-php.com/w/Switch-to-v2'
|
|
66
|
-
);
|
|
67
|
-
const version: string = await utils.parseVersion(
|
|
68
|
-
await utils.getInput('php-version', true)
|
|
69
|
-
);
|
|
70
|
-
if (version
|
|
71
|
-
core.setFailed(
|
|
72
|
-
|
|
73
|
-
);
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
if (version) {
|
|
77
|
-
const os_version: string = process.platform;
|
|
78
|
-
// check the os version and run the respective script
|
|
79
|
-
let script_path = '';
|
|
80
|
-
switch (os_version) {
|
|
81
|
-
case 'darwin':
|
|
82
|
-
case 'linux':
|
|
83
|
-
script_path = await build(os_version + '.sh', version, os_version);
|
|
84
|
-
await exec('bash ' + script_path + ' ' + version + ' ' + __dirname);
|
|
85
|
-
break;
|
|
86
|
-
case 'win32':
|
|
87
|
-
script_path = await build('win32.ps1', version, os_version);
|
|
88
|
-
await exec('pwsh ' + script_path + ' ' + version + ' ' + __dirname);
|
|
89
|
-
break;
|
|
90
|
-
}
|
|
91
|
-
} else {
|
|
92
|
-
core.setFailed('Unable to get the PHP version');
|
|
93
|
-
}
|
|
94
|
-
} catch (error) {
|
|
95
|
-
core.setFailed(error
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// call the run function
|
|
100
|
-
(async () => {
|
|
101
|
-
await run();
|
|
102
|
-
})().catch(error => {
|
|
103
|
-
core.setFailed(error.message);
|
|
104
|
-
});
|
|
1
|
+
import {exec} from '@actions/exec';
|
|
2
|
+
import * as core from '@actions/core';
|
|
3
|
+
import * as config from './config';
|
|
4
|
+
import * as coverage from './coverage';
|
|
5
|
+
import * as extensions from './extensions';
|
|
6
|
+
import * as tools from './tools';
|
|
7
|
+
import * as utils from './utils';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Build the script
|
|
11
|
+
*
|
|
12
|
+
* @param filename
|
|
13
|
+
* @param version
|
|
14
|
+
* @param os_version
|
|
15
|
+
*/
|
|
16
|
+
export async function build(
|
|
17
|
+
filename: string,
|
|
18
|
+
version: string,
|
|
19
|
+
os_version: string
|
|
20
|
+
): Promise<string> {
|
|
21
|
+
// taking inputs
|
|
22
|
+
const name = 'setup-php';
|
|
23
|
+
const url = 'https://setup-php.com/support';
|
|
24
|
+
const extension_csv: string =
|
|
25
|
+
(await utils.getInput('extensions', false)) ||
|
|
26
|
+
(await utils.getInput('extension', false)) ||
|
|
27
|
+
(await utils.getInput('extension-csv', false));
|
|
28
|
+
const ini_values_csv: string =
|
|
29
|
+
(await utils.getInput('ini-values', false)) ||
|
|
30
|
+
(await utils.getInput('ini-values-csv', false));
|
|
31
|
+
const coverage_driver: string = await utils.getInput('coverage', false);
|
|
32
|
+
const tools_csv: string = await utils.getInput('tools', false);
|
|
33
|
+
|
|
34
|
+
let script: string = await utils.readScript(filename);
|
|
35
|
+
script += await tools.addTools(tools_csv, version, os_version);
|
|
36
|
+
|
|
37
|
+
if (extension_csv) {
|
|
38
|
+
script += await extensions.addExtension(extension_csv, version, os_version);
|
|
39
|
+
}
|
|
40
|
+
if (coverage_driver) {
|
|
41
|
+
script += await coverage.addCoverage(coverage_driver, version, os_version);
|
|
42
|
+
}
|
|
43
|
+
if (ini_values_csv) {
|
|
44
|
+
script += await config.addINIValues(ini_values_csv, os_version);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
script += '\n' + (await utils.stepLog('Support this project', os_version));
|
|
48
|
+
script += '\n' + (await utils.addLog('$tick', name, url, os_version));
|
|
49
|
+
|
|
50
|
+
return await utils.writeScript(filename, script);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Run the script
|
|
55
|
+
*/
|
|
56
|
+
export async function run(): Promise<void> {
|
|
57
|
+
try {
|
|
58
|
+
if ((await utils.readEnv('ImageOS')) == 'ubuntu16') {
|
|
59
|
+
core.setFailed(
|
|
60
|
+
'setup-php is not supported on Ubuntu 16.04. Please upgrade to Ubuntu 18.04 or Ubuntu 20.04 - https://setup-php.com/i/452'
|
|
61
|
+
);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
core.warning(
|
|
65
|
+
'setup-php v1 is deprecated.\nPlease upgrade to v2 - https://setup-php.com/w/Switch-to-v2'
|
|
66
|
+
);
|
|
67
|
+
const version: string = await utils.parseVersion(
|
|
68
|
+
await utils.getInput('php-version', true)
|
|
69
|
+
);
|
|
70
|
+
if (parseFloat(version) < 5.6 || parseFloat(version) > 8.0) {
|
|
71
|
+
core.setFailed(
|
|
72
|
+
`setup-php v1 supports only PHP 5.6 to 8.0.\nPlease upgrade to v2 - https://setup-php.com/w/Switch-to-v2`
|
|
73
|
+
);
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (version) {
|
|
77
|
+
const os_version: string = process.platform;
|
|
78
|
+
// check the os version and run the respective script
|
|
79
|
+
let script_path = '';
|
|
80
|
+
switch (os_version) {
|
|
81
|
+
case 'darwin':
|
|
82
|
+
case 'linux':
|
|
83
|
+
script_path = await build(os_version + '.sh', version, os_version);
|
|
84
|
+
await exec('bash ' + script_path + ' ' + version + ' ' + __dirname);
|
|
85
|
+
break;
|
|
86
|
+
case 'win32':
|
|
87
|
+
script_path = await build('win32.ps1', version, os_version);
|
|
88
|
+
await exec('pwsh ' + script_path + ' ' + version + ' ' + __dirname);
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
} else {
|
|
92
|
+
core.setFailed('Unable to get the PHP version');
|
|
93
|
+
}
|
|
94
|
+
} catch (error) {
|
|
95
|
+
core.setFailed(error as Error);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// call the run function
|
|
100
|
+
(async () => {
|
|
101
|
+
await run();
|
|
102
|
+
})().catch(error => {
|
|
103
|
+
core.setFailed(error.message);
|
|
104
|
+
});
|