20 Commits
1.1.0 ... 1.4.0

Author SHA1 Message Date
Shivam Mathur
7df1333d2b Merge pull request #20 from shivammathur/develop
1.4.0
2020-12-30 14:20:37 -08:00
Shivam Mathur
9ef47bc1b1 Change extensions directory for PHP 5.3 on Ubuntu
Add support for PHP 5.6+ on MacOS ARM

Update lists for PHP 5.3

Clear cache

Bump version to 1.4.0
2020-12-31 03:47:46 +05:30
Shivam Mathur
bc3f3bc008 Merge pull request #19 from shivammathur/develop
1.3.3
2020-12-16 23:49:46 -08:00
Shivam Mathur
30e4da7ed2 Adjust extension_dir for PHP 8 on Ubuntu
Reset extension cache

Update dependencies

Update lists
2020-12-17 13:16:33 +05:30
Shivam Mathur
1b7b26deeb Merge pull request #18 from shivammathur/develop
1.3.2
2020-11-26 21:14:56 +05:30
Shivam Mathur
0487f686e2 Clear cache
Bump version to 1.3.2

Update dependencies
2020-11-26 21:14:34 +05:30
Shivam Mathur
f5a7bad686 Merge pull request #17 from shivammathur/develop
1.3.1
2020-10-24 07:40:06 +05:30
Shivam Mathur
d48014e2bb Add PHP 8.1 and macos-11.0 to the README
Update Node.js dependencies

Bump version to 1.3.1
2020-10-24 07:31:37 +05:30
Shivam Mathur
3809746e7d Merge pull request #16 from shivammathur/develop
1.3.0
2020-10-13 14:29:02 +05:30
Shivam Mathur
f55a0043ab Add support for PHP 8.1
Add support for alias latest

Bump version to 1.3.0
2020-10-13 14:22:54 +05:30
Shivam Mathur
154644c7b4 Merge pull request #15 from shivammathur/develop
1.2.0
2020-09-30 10:13:45 +05:30
Shivam Mathur
60ee2fe878 Bump version to 1.2.0 2020-09-30 10:08:07 +05:30
Shivam Mathur
4db45d6171 Merge pull request #14 from shivammathur/develop
1.1.3
2020-08-10 12:39:37 +05:30
Shivam Mathur
7045a9c4c7 Add cubrid to the lists
Update README

Bump version to 1.1.3
2020-08-10 12:22:10 +05:30
Shivam Mathur
506984d835 Merge pull request #13 from shivammathur/develop
1.1.2
2020-08-04 06:50:24 +05:30
Shivam Mathur
f94c56d97f Change PHP 8.0 prefix for linux
Update extension lists

Bump version to 1.1.2
2020-08-04 05:55:46 +05:30
Shivam Mathur
4309c25508 Merge pull request #12 from shivammathur/develop
Hotfix in 1.1.1
2020-07-18 22:16:55 +05:30
Shivam Mathur
7af896286c Update dependencies
Apply GHSA-p6mc-m468-83gw advisory to fix prototype pollution in lodash
2020-07-18 22:09:33 +05:30
Shivam Mathur
9666885116 Merge pull request #11 from shivammathur/develop
1.1.1
2020-06-19 10:37:03 +05:30
Shivam Mathur
7963f6b10a Bump version to 1.1.1 2020-06-19 10:27:23 +05:30
50 changed files with 2050 additions and 2360 deletions

View File

@@ -1,7 +1,7 @@
{ {
"env": { "node": true, "jest": true }, "env": { "node": true, "jest": true },
"parser": "@typescript-eslint/parser", "parser": "@typescript-eslint/parser",
"parserOptions": { "ecmaVersion": 2020, "sourceType": "module" }, "parserOptions": { "ecmaVersion": 2019, "sourceType": "module" },
"extends": [ "extends": [
"eslint:recommended", "eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended", "plugin:@typescript-eslint/eslint-recommended",

6
.github/FUNDING.yml vendored
View File

@@ -1,7 +1,7 @@
# These are supported funding model platforms # These are supported funding model platforms
github: shivammathur open_collective: setup-php
issuehunt: shivammathur tidelift: "npm/setup-php"
community_bridge: setup-php
patreon: shivammathur patreon: shivammathur
liberapay: shivammathur
custom: https://www.paypal.me/shivammathur custom: https://www.paypal.me/shivammathur

View File

@@ -1,23 +1,42 @@
--- ---
name: Bug report name: Bug report
about: Create a report to help us improve about: Nice, you found a bug!
title: '' title: ''
labels: '' labels: 'bug'
assignees: '' assignees: 'shivammathur'
--- ---
**Describe the bug** **Describe the bug**
A clear and concise description of what the bug is. <!-- Please describe the bug concisely. -->
**Version**
- [ ] I have checked releases and the bug exists in the latest patch version of `v1`.
- [ ] `v2`
- [ ] `v1`
**Runners**
<!-- Please mark the GitHub Action runner your workflow uses. -->
- [ ] GitHub Hosted
- [ ] Self Hosted
**Operating systems**
<!-- Please mention the operating systems your workflow uses. -->
**PHP versions**
<!-- Please mention the PHP versions your workflow uses. -->
**To Reproduce** **To Reproduce**
Please provide the GitHub Action `.yml` file. <!-- Please provide the relevant steps of your workflow `.yml` file. -->
**Expected behavior** **Expected behavior**
A clear and concise description of what you expected to happen. <!-- A clear and concise description of what you expected to happen. -->
**Screenshots** **Screenshots/Logs**
If applicable, add screenshots to help explain your problem. <!-- If applicable, add screenshots or logs to help explain your problem. -->
**Additional context** **Additional context**
Add any other context about the problem here. <!-- Add any other context about the problem here. -->
**Are you willing to submit a PR?**
<!-- We accept pull requests targeting the develop branch. -->

View File

@@ -1,20 +1,26 @@
--- ---
name: Feature request name: Feature request
about: Suggest an idea for this project about: Suggest a new feature
title: '' title: ''
labels: '' labels: 'enhancement'
assignees: '' assignees: 'shivammathur'
--- ---
**Is your feature request related to a problem? Please describe.** **Describe the feature**
A clear and concise description of what the problem is. Ex. I want to improve [...] <!-- Please describe concisely the feature you want to add. -->
**Describe the solution you'd like** **Version**
A clear and concise description of what you want to happen. - [ ] I have checked releases and the feature is missing in the latest patch version of `v1`.
**Describe alternatives you've considered** **Underlying issue**
A clear and concise description of any alternative solutions or features you've considered. <!-- Please describe the issue this would solve. -->
**Describe alternatives**
<!-- Please mention any alternative solutions you've considered. -->
**Additional context** **Additional context**
Add any other context or screenshots about the feature request here. <!-- Add any other context or screenshots about the feature request here. -->
**Are you willing to submit a PR?**
<!-- We accept pull requests targeting the develop branch. -->

View File

@@ -7,14 +7,13 @@ labels: bug or enhancement
## A Pull Request should be associated with an Issue. ## A Pull Request should be associated with an Issue.
> We wish to have discussions in Issues. A single issue may be targeted by multiple PRs. > If you're fixing a bug, adding a new feature or improving something please provide the details in Issues,
> If you're offering a new feature or fixing anything, we'd like to know beforehand in Issues, > so that the development can be pointed in the intended direction.
> and potentially we'll be able to point development in a particular direction.
Related issue: Related issue: <!-- Please link the related issue -->
> Further notes in [Contribution Guidelines](.github/CONTRIBUTING.md) > Further notes in [Contribution Guidelines](.github/CONTRIBUTING.md)
> Thank you! We are open to PRs, but please understand if for technical reasons we are unable to accept each and any PR > Thank you for your contribution.
### Description ### Description
@@ -26,7 +25,12 @@ This PR [briefly explain what it does]
- [ ] I have run `npm run format` before the commit. - [ ] I have run `npm run format` before the commit.
- [ ] I have run `npm run lint` before the commit. - [ ] I have run `npm run lint` before the commit.
- [ ] I have run `npm run release` before the commit. - [ ] I have run `npm run release` before the commit.
- [ ] `npm test` returns with no unit test errors. - [ ] `npm test` returns with no unit test errors and all code covered.
> In case this PR edits any scripts:
- [ ] I have checked the edited scripts for syntax.
- [ ] I have tested the changes in an integration test (If yes, provide workflow link).
<!-- <!--
- Please target the develop branch when submitting the pull request. - Please target the develop branch when submitting the pull request.

View File

@@ -1,33 +0,0 @@
---
name: 🐞 Bug Fix
about: You have a fix for a bug?
labels: bug
---
## A Pull Request should be associated with an Issue.
> We wish to have discussions in Issues. A single issue may be targeted by multiple PRs.
> If you're offering a new feature or fixing anything, we'd like to know beforehand in Issues,
> and potentially we'll be able to point development in a particular direction.
Related issue:
> Further notes in [Contribution Guidelines](.github/CONTRIBUTING.md)
> Thank you! We are open to PRs, but please understand if for technical reasons we are unable to accept each and any PR
### Description
This PR [briefly explain what it does]
> In case this PR introduced TypeScript/JavaScript code changes:
- [ ] I have written test cases for the changes in this pull request.
- [ ] I have run `npm run format` before the commit.
- [ ] I have run `npm run lint` before the commit.
- [ ] I have run `npm run release` before the commit.
- [ ] `npm test` returns with no unit test errors.
<!--
- Please target the develop branch when submitting the pull request.
-->

View File

@@ -1,33 +0,0 @@
---
name: ⚙ Improvement
about: You have some improvement to make cache-extensions better?
labels: enhancement
---
## A Pull Request should be associated with an Issue.
> We wish to have discussions in Issues. A single issue may be targeted by multiple PRs.
> If you're offering a new feature or fixing anything, we'd like to know beforehand in Issues,
> and potentially we'll be able to point development in a particular direction.
Related issue:
> Further notes in [Contribution Guidelines](.github/CONTRIBUTING.md)
> Thank you! We are open to PRs, but please understand if for technical reasons we are unable to accept each and any PR
### Description
This PR [briefly explain what it does]
> In case this PR introduced TypeScript/JavaScript code changes:
- [ ] I have written test cases for the changes in this pull request.
- [ ] I have run `npm run format` before the commit.
- [ ] I have run `npm run lint` before the commit.
- [ ] I have run `npm run release` before the commit.
- [ ] `npm test` returns with no unit test errors.
<!--
- Please target the develop branch when submitting the pull request.
-->

View File

@@ -1,33 +0,0 @@
---
name: 🎉 New Feature
about: You have implemented some neat idea that you want to make part of cache-extensions?
labels: enhancement
---
## A Pull Request should be associated with an Issue.
> We wish to have discussions in Issues. A single issue may be targeted by multiple PRs.
> If you're offering a new feature or fixing anything, we'd like to know beforehand in Issues,
> and potentially we'll be able to point development in a particular direction.
Related issue:
> Further notes in [Contribution Guidelines](.github/CONTRIBUTING.md)
> Thank you! We are open to PRs, but please understand if for technical reasons we are unable to accept each and any PR
### Description
This PR [briefly explain what it does]
> In case this PR introduced TypeScript/JavaScript code changes:
- [ ] I have written test cases for the changes in this pull request.
- [ ] I have run `npm run format` before the commit.
- [ ] I have run `npm run lint` before the commit.
- [ ] I have run `npm run release` before the commit.
- [ ] `npm test` returns with no unit test errors.
<!--
- Please target the develop branch when submitting the pull request.
-->

View File

@@ -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.
@@ -14,9 +14,13 @@ Cache PHP extensions in [GitHub Actions](https://github.com/features/actions "Gi
- [PHP Support](#tada-php-support) - [PHP Support](#tada-php-support)
- [OS/Platform Support](#cloud-osplatform-support) - [OS/Platform Support](#cloud-osplatform-support)
- [Usage](#memo-usage) - [Usage](#memo-usage)
- [Inputs](#inputs)
- [Workflow](#workflow)
- [Thread Safe Setup](#thread-safe-setup)
- [License](#scroll-license) - [License](#scroll-license)
- [Contributions](#1-contributions) - [Contributions](#1-contributions)
- [Support this project](#sparkling_heart-support-this-project) - [Support This Project](#sparkling_heart-support-this-project)
- [Dependencies](#package-dependencies)
## :tada: PHP Support ## :tada: PHP Support
@@ -28,30 +32,51 @@ 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|`Experimental`|`In development`| |8.0|`Stable`|`Active`|
|8.1|`Nightly`|`In development`|
## :cloud: OS/Platform Support ## :cloud: OS/Platform Support
|Virtual environment|matrix.operating-system| |Virtual environment|YAML workflow label|
|--- |--- | |--- |--- |
|Windows Server 2019|`windows-latest` or `windows-2019`| |Windows Server 2019|`windows-latest` or `windows-2019`|
|Ubuntu 20.04|`ubuntu-20.04`|
|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 X 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
Inputs supported by this GitHub Action. 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.
- php-version `required` ### Inputs
- extensions `required`
- key `required` #### `php-version` (required)
- Specify the PHP version you want to set up.
- Accepts a `string`. For example `'7.4'`.
- See [PHP support](#tada-php-support) for supported PHP versions.
#### `extensions` (required)
- Specify the extensions you want to add or remove.
- Accepts a `string` in csv-format. For example `mbstring, , xdebug, :opcache`.
- Extensions prefixed with `:` are ignored.
#### `key` (required)
- Specify the key to identify the cache version.
- Accepts any `string`. For example `cache-v1`.
- Changing this would reset the cache.
See [action.yml](action.yml "Metadata for this GitHub Action") and usage below for more info. See [action.yml](action.yml "Metadata for this GitHub Action") and usage below for more info.
### Workflow
> Cache extensions in a PHP workflow > Cache extensions in a PHP workflow
```yaml ```yaml
@@ -71,7 +96,7 @@ jobs:
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Setup cache environment - name: Setup cache environment
id: cache-env id: extcache
uses: shivammathur/cache-extensions@v1 uses: shivammathur/cache-extensions@v1
with: with:
php-version: ${{ matrix.php-versions }} php-version: ${{ matrix.php-versions }}
@@ -81,9 +106,9 @@ jobs:
- name: Cache extensions - name: Cache extensions
uses: actions/cache@v2 uses: actions/cache@v2
with: with:
path: ${{ steps.cache-env.outputs.dir }} path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.cache-env.outputs.key }} key: ${{ steps.extcache.outputs.key }}
restore-keys: ${{ steps.cache-env.outputs.key }} restore-keys: ${{ steps.extcache.outputs.key }}
- name: Setup PHP - name: Setup PHP
uses: shivammathur/setup-php@v2 uses: shivammathur/setup-php@v2
@@ -92,19 +117,35 @@ jobs:
extensions: ${{ env.extensions }} extensions: ${{ env.extensions }}
``` ```
### Thread Safe Setup
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
- name: Cache extensions
uses: actions/cache@v2
with:
path: ${{ steps.extcache.outputs.dir }}
key: ${{ steps.extcache.outputs.key }}-${{ env.phpts }}
restore-keys: ${{ steps.extcache.outputs.key }}-${{ env.phpts }}
```
## :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
Contributions are welcome! See [Contributor's Guide](.github/CONTRIBUTING.md "shivammathur/cache-extensions contribution guide"). If you face any issues while using this or want to suggest a feature/improvement, create an issue [here](https://github.com/shivammathur/cache-extensions/issues "Issues reported"). Contributions are welcome! See [Contributor's Guide](.github/CONTRIBUTING.md "shivammathur/cache-extensions contribution guide"). If you face any issues while using this or want to suggest a feature/improvement, create an issue [here](https://github.com/shivammathur/cache-extensions/issues "Issues reported").
## :sparkling_heart: Support this project ## :sparkling_heart: Support This Project
If this action helped you. If this action helped you.
- Please star the project and share it with the community. - Please star the project and share it. If you blog, please share your experience of using this action.
- If you blog, write about your experience while using this action. - 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").
- I maintain this in my free time, please support me with a [Patreon](https://www.patreon.com/shivammathur "Shivam Mathur Patreon") subscription or a one time contribution using [Paypal](https://www.paypal.me/shivammathur "Shivam Mathur PayPal"). - If you use this action at your company, please [reach out](mailto:contact@setup-php.com) to sponsor the project.
- If you need any help using this, please contact me using [Codementor](https://www.codementor.io/shivammathur "Shivam Mathur Codementor")
## :package: Dependencies
- [Node.js dependencies](https://github.com/shivammathur/setup-php/network/dependencies "Node.js dependencies")

View File

@@ -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 () => {

226
dist/index.js vendored
View File

@@ -953,6 +953,32 @@ class ExecState extends events.EventEmitter {
/***/ }), /***/ }),
/***/ 82:
/***/ (function(__unusedmodule, exports) {
"use strict";
// We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Sanitizes an input into a string so it can be passed into issueCommand safely
* @param input input to sanitize into a string
*/
function toCommandValue(input) {
if (input === null || input === undefined) {
return '';
}
else if (typeof input === 'string' || input instanceof String) {
return input;
}
return JSON.stringify(input);
}
exports.toCommandValue = toCommandValue;
//# sourceMappingURL=utils.js.map
/***/ }),
/***/ 87: /***/ 87:
/***/ (function(module) { /***/ (function(module) {
@@ -960,6 +986,42 @@ module.exports = require("os");
/***/ }), /***/ }),
/***/ 102:
/***/ (function(__unusedmodule, exports, __webpack_require__) {
"use strict";
// For internal use, subject to change.
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
result["default"] = mod;
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
// We use any as a valid input type
/* eslint-disable @typescript-eslint/no-explicit-any */
const fs = __importStar(__webpack_require__(747));
const os = __importStar(__webpack_require__(87));
const utils_1 = __webpack_require__(82);
function issueCommand(command, message) {
const filePath = process.env[`GITHUB_${command}`];
if (!filePath) {
throw new Error(`Unable to find environment variable for file command ${command}`);
}
if (!fs.existsSync(filePath)) {
throw new Error(`Missing file at path: ${filePath}`);
}
fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {
encoding: 'utf8'
});
}
exports.issueCommand = issueCommand;
//# sourceMappingURL=file-command.js.map
/***/ }),
/***/ 129: /***/ 129:
/***/ (function(module) { /***/ (function(module) {
@@ -987,55 +1049,80 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
var __importStar = (this && this.__importStar) || function (mod) { var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod; if (mod && mod.__esModule) return mod;
var result = {}; var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
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.
* *
* @param name * @param name
* @param mandatory * @param mandatory
*/ */
function getInput(name, mandatory) { async function getInput(name, mandatory) {
return __awaiter(this, void 0, void 0, function* () { const input = core.getInput(name);
const input = process.env[name]; const env_input = await readEnv(name);
switch (input) { switch (true) {
case '': case input != '':
case undefined: return input;
return core.getInput(name, { required: mandatory }); case input == '' && env_input != '':
default: return env_input;
return 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
* *
* @param extension_csv * @param extension_csv
*/ */
function filterExtensions(extension_csv) { async function filterExtensions(extension_csv) {
return __awaiter(this, void 0, void 0, function* () { return extension_csv
return extension_csv .split(',')
.split(',') .filter(extension => {
.filter(extension => { return extension.trim()[0] != ':';
return extension.trim()[0] != ':'; })
}) .join(',');
.join(',');
});
} }
exports.filterExtensions = filterExtensions; exports.filterExtensions = filterExtensions;
@@ -1063,6 +1150,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const os = __importStar(__webpack_require__(87)); const os = __importStar(__webpack_require__(87));
const utils_1 = __webpack_require__(82);
/** /**
* Commands * Commands
* *
@@ -1116,28 +1204,14 @@ class Command {
return cmdStr; return cmdStr;
} }
} }
/**
* Sanitizes an input into a string so it can be passed into issueCommand safely
* @param input input to sanitize into a string
*/
function toCommandValue(input) {
if (input === null || input === undefined) {
return '';
}
else if (typeof input === 'string' || input instanceof String) {
return input;
}
return JSON.stringify(input);
}
exports.toCommandValue = toCommandValue;
function escapeData(s) { function escapeData(s) {
return toCommandValue(s) return utils_1.toCommandValue(s)
.replace(/%/g, '%25') .replace(/%/g, '%25')
.replace(/\r/g, '%0D') .replace(/\r/g, '%0D')
.replace(/\n/g, '%0A'); .replace(/\n/g, '%0A');
} }
function escapeProperty(s) { function escapeProperty(s) {
return toCommandValue(s) return utils_1.toCommandValue(s)
.replace(/%/g, '%25') .replace(/%/g, '%25')
.replace(/\r/g, '%0D') .replace(/\r/g, '%0D')
.replace(/\n/g, '%0A') .replace(/\n/g, '%0A')
@@ -1171,6 +1245,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
}; };
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const command_1 = __webpack_require__(431); const command_1 = __webpack_require__(431);
const file_command_1 = __webpack_require__(102);
const utils_1 = __webpack_require__(82);
const os = __importStar(__webpack_require__(87)); const os = __importStar(__webpack_require__(87));
const path = __importStar(__webpack_require__(622)); const path = __importStar(__webpack_require__(622));
/** /**
@@ -1197,9 +1273,17 @@ var ExitCode;
*/ */
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
function exportVariable(name, val) { function exportVariable(name, val) {
const convertedVal = command_1.toCommandValue(val); const convertedVal = utils_1.toCommandValue(val);
process.env[name] = convertedVal; process.env[name] = convertedVal;
command_1.issueCommand('set-env', { name }, convertedVal); const filePath = process.env['GITHUB_ENV'] || '';
if (filePath) {
const delimiter = '_GitHubActionsFileCommandDelimeter_';
const commandValue = `${name}<<${delimiter}${os.EOL}${convertedVal}${os.EOL}${delimiter}`;
file_command_1.issueCommand('ENV', commandValue);
}
else {
command_1.issueCommand('set-env', { name }, convertedVal);
}
} }
exports.exportVariable = exportVariable; exports.exportVariable = exportVariable;
/** /**
@@ -1215,7 +1299,13 @@ exports.setSecret = setSecret;
* @param inputPath * @param inputPath
*/ */
function addPath(inputPath) { function addPath(inputPath) {
command_1.issueCommand('add-path', {}, inputPath); const filePath = process.env['GITHUB_PATH'] || '';
if (filePath) {
file_command_1.issueCommand('PATH', inputPath);
}
else {
command_1.issueCommand('add-path', {}, inputPath);
}
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`; process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
} }
exports.addPath = addPath; exports.addPath = addPath;
@@ -1620,19 +1710,10 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
var __importStar = (this && this.__importStar) || function (mod) { var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod; if (mod && mod.__esModule) return mod;
var result = {}; var result = {};
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.run = void 0; exports.run = void 0;
const exec_1 = __webpack_require__(986); const exec_1 = __webpack_require__(986);
@@ -1642,20 +1723,17 @@ const utils = __importStar(__webpack_require__(163));
/** /**
* Run the script * Run the script
*/ */
function run() { async function run() {
return __awaiter(this, void 0, void 0, function* () { try {
try { const version = await utils.parseVersion(await utils.getInput('php-version', true));
let version = yield utils.getInput('php-version', true); const extensions = await utils.filterExtensions(await utils.getInput('extensions', true));
version = version.length > 1 ? version.slice(0, 3) : version + '.0'; const key = await utils.getInput('key', true);
const extensions = yield utils.filterExtensions(yield utils.getInput('extensions', true)); const script_path = path.join(__dirname, '../src/extensions.sh');
const key = yield utils.getInput('key', true); await exec_1.exec('bash ' + script_path + ' "' + extensions + '" ' + key + ' ' + version);
const script_path = path.join(__dirname, '../src/extensions.sh'); }
yield exec_1.exec('bash ' + script_path + ' "' + extensions + '" ' + key + ' ' + version); catch (error) {
} core.setFailed(error.message);
catch (error) { }
core.setFailed(error.message);
}
});
} }
exports.run = run; exports.run = run;
// call the run function // call the run function

3297
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "cache-extensions", "name": "cache-extensions",
"version": "1.1.0", "version": "1.4.0",
"private": false, "private": false,
"description": "Cache extensions in GitHub Actions", "description": "Cache extensions in GitHub Actions",
"main": "dist/index.js", "main": "dist/index.js",
@@ -24,26 +24,26 @@
"author": "shivammathur", "author": "shivammathur",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "^1.2.4", "@actions/core": "^1.2.6",
"@actions/exec": "^1.0.4" "@actions/exec": "^1.0.4"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^25.2.3", "@types/jest": "^26.0.19",
"@types/node": "^14.0.9", "@types/node": "^14.14.17",
"@typescript-eslint/eslint-plugin": "^3.1.0", "@typescript-eslint/eslint-plugin": "^4.11.1",
"@typescript-eslint/parser": "^3.1.0", "@typescript-eslint/parser": "^4.11.1",
"@zeit/ncc": "^0.22.3", "@zeit/ncc": "^0.22.3",
"eslint": "^7.1.0", "eslint": "^7.16.0",
"eslint-config-prettier": "^6.11.0", "eslint-config-prettier": "^7.1.0",
"eslint-plugin-import": "^2.20.2", "eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^23.13.2", "eslint-plugin-jest": "^24.1.3",
"eslint-plugin-prettier": "^3.1.3", "eslint-plugin-prettier": "^3.3.0",
"husky": "^4.2.5", "husky": "^4.3.6",
"jest": "^26.0.1", "jest": "^26.6.3",
"jest-circus": "^26.0.1", "jest-circus": "^26.6.3",
"prettier": "^2.0.5", "prettier": "^2.2.1",
"ts-jest": "^26.1.0", "ts-jest": "^26.4.4",
"typescript": "^3.9.3" "typescript": "^4.1.3"
}, },
"husky": { "husky": {
"skipCI": true, "skipCI": true,

View File

@@ -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);

View File

@@ -1,12 +1,9 @@
linux_extension_dir() { linux_extension_dir() {
apiv=$1 apiv=$1
old_versions_linux="5.[4-5]" if [[ "$version" =~ $old_versions ]]; then
if [ "$version" = "5.3" ]; then
echo "/home/runner/php/5.3.29/lib/php/extensions/no-debug-non-zts-$apiv"
elif [[ "$version" =~ $old_versions_linux ]]; then
echo "/usr/lib/php5/$apiv" echo "/usr/lib/php5/$apiv"
elif [ "$version" = "8.0" ]; then elif [[ "$version" =~ 5.3|$nightly_versions ]]; then
echo "/home/runner/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
@@ -18,7 +15,11 @@ darwin_extension_dir() {
if [[ "$version" =~ $old_versions_darwin ]]; then if [[ "$version" =~ $old_versions_darwin ]]; then
echo "/opt/local/lib/php${version/./}/extensions/no-debug-non-zts-$apiv" echo "/opt/local/lib/php${version/./}/extensions/no-debug-non-zts-$apiv"
else else
echo "/usr/local/lib/php/pecl/$apiv" if [[ "$(sysctl -n hw.optional.arm64 2>/dev/null)" = "1" ]]; then
echo "/opt/homebrew/lib/php/pecl/$apiv"
else
echo "/usr/local/lib/php/pecl/$apiv"
fi
fi fi
} }
@@ -33,6 +34,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 +75,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.[1-9]"
if [ "$os" = "Linux" ]; then if [ "$os" = "Linux" ]; then
release=$(lsb_release -s -c) release=$(lsb_release -s -c)
os=$os-$release os=$os-$release
@@ -87,10 +91,8 @@ elif [ "$os" = "Darwin" ]; then
else else
os="Windows" os="Windows"
dir='C:\\tools\\php\\ext' dir='C:\\tools\\php\\ext'
if [ "$version" = "8.0" ] && [[ "$extensions" == *pcov* ]]; then
key="$key-pcov_20200410"
fi
fi 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-20201231"
echo "::set-output name=dir::$dir" echo "::set-output name=dir::$dir"
echo "::set-output name=key::$key" echo "::set-output name=key::$key"

View File

@@ -1,28 +1,37 @@
[PHP Modules] [PHP Modules]
amqp
apc apc
apcu apcu
bcmath bcmath
bz2 bz2
Core Core
ctype ctype
cubrid
curl curl
date date
dom dom
enchant
ereg ereg
exif exif
fileinfo fileinfo
filter filter
ftp ftp
gd gd
gettext
gmp
hash hash
iconv iconv
ioncube
intl intl
json json
ldap
libxml libxml
mbstring mbstring
mcrypt mcrypt
memcache
memcached memcached
mongo mongo
mongodb
mysql mysql
mysqli mysqli
mysqlnd mysqlnd
@@ -31,10 +40,15 @@ pcntl
pcov pcov
pcre pcre
PDO PDO
oci8
PDO_OCI
pdo_mysql pdo_mysql
pdo_pgsql
pdo_sqlite pdo_sqlite
pgsql
Phar Phar
posix posix
pspell
readline readline
redis redis
Reflection Reflection
@@ -65,4 +79,3 @@ blackfire
[Zend Modules] [Zend Modules]
Xdebug Xdebug

View File

@@ -6,6 +6,7 @@ bz2
calendar calendar
Core Core
ctype ctype
cubrid
curl curl
date date
dba dba
@@ -20,6 +21,7 @@ gettext
hash hash
iconv iconv
imagick imagick
ioncube
intl intl
json json
libxml libxml
@@ -34,6 +36,8 @@ pcntl
pcov pcov
pcre pcre
PDO PDO
oci8
PDO_OCI
pdo_mysql pdo_mysql
pdo_pgsql pdo_pgsql
pdo_sqlite pdo_sqlite

View File

@@ -6,6 +6,7 @@ bz2
calendar calendar
Core Core
ctype ctype
cubrid
curl curl
date date
dba dba
@@ -20,6 +21,7 @@ gettext
hash hash
iconv iconv
imagick imagick
ioncube
intl intl
json json
libxml libxml
@@ -34,6 +36,8 @@ pcntl
pcov pcov
pcre pcre
PDO PDO
oci8
PDO_OCI
pdo_mysql pdo_mysql
pdo_pgsql pdo_pgsql
pdo_sqlite pdo_sqlite

View File

@@ -5,6 +5,7 @@ apcu
calendar calendar
Core Core
ctype ctype
cubrid
curl curl
date date
dom dom
@@ -17,6 +18,7 @@ gettext
hash hash
iconv iconv
igbinary igbinary
ioncube
intl intl
json json
libxml libxml

View File

@@ -4,6 +4,7 @@ apcu
calendar calendar
Core Core
ctype ctype
cubrid
curl curl
date date
dom dom
@@ -15,6 +16,7 @@ gettext
hash hash
iconv iconv
igbinary igbinary
ioncube
intl intl
json json
libxml libxml

View File

@@ -6,6 +6,7 @@ bz2
calendar calendar
Core Core
ctype ctype
cubrid
curl curl
date date
dba dba
@@ -23,6 +24,7 @@ iconv
igbinary igbinary
imap imap
interbase interbase
ioncube
intl intl
json json
ldap ldap
@@ -42,6 +44,8 @@ pcre
PDO PDO
pdo_dblib pdo_dblib
PDO_Firebird PDO_Firebird
oci8
PDO_OCI
pdo_mysql pdo_mysql
PDO_ODBC PDO_ODBC
pdo_pgsql pdo_pgsql

View File

@@ -6,6 +6,7 @@ bz2
calendar calendar
Core Core
ctype ctype
cubrid
curl curl
date date
dba dba
@@ -23,6 +24,7 @@ iconv
igbinary igbinary
imap imap
interbase interbase
ioncube
intl intl
json json
ldap ldap
@@ -41,6 +43,8 @@ pcre
PDO PDO
pdo_dblib pdo_dblib
PDO_Firebird PDO_Firebird
oci8
PDO_OCI
pdo_mysql pdo_mysql
PDO_ODBC PDO_ODBC
pdo_pgsql pdo_pgsql

View File

@@ -6,6 +6,7 @@ bz2
calendar calendar
Core Core
ctype ctype
cubrid
curl curl
date date
dba dba
@@ -23,6 +24,7 @@ iconv
igbinary igbinary
imap imap
interbase interbase
ioncube
intl intl
json json
ldap ldap
@@ -41,6 +43,8 @@ pcre
PDO PDO
pdo_dblib pdo_dblib
PDO_Firebird PDO_Firebird
oci8
PDO_OCI
pdo_mysql pdo_mysql
PDO_ODBC PDO_ODBC
pdo_pgsql pdo_pgsql

View File

@@ -6,6 +6,7 @@ bz2
calendar calendar
Core Core
ctype ctype
cubrid
curl curl
date date
dba dba
@@ -23,6 +24,7 @@ hash
iconv iconv
igbinary igbinary
imap imap
ioncube
intl intl
json json
ldap ldap
@@ -41,6 +43,8 @@ pcre
PDO PDO
pdo_dblib pdo_dblib
PDO_Firebird PDO_Firebird
oci8
PDO_OCI
pdo_mysql pdo_mysql
PDO_ODBC PDO_ODBC
pdo_pgsql pdo_pgsql
@@ -85,4 +89,3 @@ blackfire
[Zend Modules] [Zend Modules]
Xdebug Xdebug
Zend OPcache Zend OPcache

View File

@@ -1,4 +1,6 @@
[PHP Modules] [PHP Modules]
amqp
apcu
bcmath bcmath
bz2 bz2
calendar calendar
@@ -6,6 +8,7 @@ Core
ctype ctype
curl curl
date date
dba
dom dom
enchant enchant
exif exif
@@ -18,18 +21,30 @@ gettext
gmp gmp
hash hash
iconv iconv
igbinary
imap
intl intl
json json
ldap
libxml libxml
mbstring mbstring
memcache
memcached
mongodb
msgpack
mysqli mysqli
mysqlnd mysqlnd
odbc
openssl openssl
pcntl pcntl
pcov
pcre pcre
PDO PDO
oci8
PDO_OCI
pdo_dblib
PDO_Firebird
pdo_mysql pdo_mysql
PDO_ODBC
pdo_pgsql pdo_pgsql
pdo_sqlite pdo_sqlite
pgsql pgsql
@@ -37,12 +52,15 @@ Phar
posix posix
pspell pspell
readline readline
redis
Reflection Reflection
session session
shmop shmop
SimpleXML SimpleXML
snmp
soap soap
sockets sockets
sodium
SPL SPL
sqlite3 sqlite3
standard standard
@@ -51,18 +69,21 @@ sysvsem
sysvshm sysvshm
tidy tidy
tokenizer tokenizer
xdebug
xml xml
xmlreader xmlreader
xmlrpc
xmlwriter xmlwriter
xsl xsl
yaml
Zend OPcache Zend OPcache
zip zip
zlib zlib
zmq
ioncube
phalcon3 phalcon3
phalcon4 phalcon4
blackfire blackfire
[Zend Modules] [Zend Modules]
Xdebug
Zend OPcache Zend OPcache

View 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

View File

@@ -1,38 +1,56 @@
[PHP Modules] [PHP Modules]
amqp
apc apc
apcu apcu
bcmath bcmath
bz2 bz2
Core Core
ctype ctype
cubrid
curl curl
date date
dom dom
enchant
ereg ereg
exif exif
fileinfo fileinfo
filter filter
ftp ftp
gd gd
gettext
gmp
hash hash
iconv iconv
ioncube
intl intl
json json
ldap
libxml libxml
mbstring mbstring
mcrypt mcrypt
memcache
memcached
mongo
mongodb
mysql mysql
mysqli mysqli
mysqlnd mysqlnd
openssl openssl
pcntl pcntl
pcov
pcre pcre
PDO PDO
oci8
PDO_OCI
pdo_mysql pdo_mysql
pdo_pgsql
pdo_sqlite pdo_sqlite
pgsql
Phar Phar
posix posix
pspell
readline readline
redis
Reflection Reflection
session session
shmop shmop
@@ -61,4 +79,3 @@ blackfire
[Zend Modules] [Zend Modules]
Xdebug Xdebug

View File

@@ -6,6 +6,7 @@ bz2
calendar calendar
Core Core
ctype ctype
cubrid
curl curl
date date
dba dba
@@ -20,6 +21,7 @@ gettext
hash hash
iconv iconv
imagick imagick
ioncube
intl intl
json json
libxml libxml
@@ -33,6 +35,8 @@ openssl
pcntl pcntl
pcre pcre
PDO PDO
oci8
PDO_OCI
pdo_mysql pdo_mysql
pdo_pgsql pdo_pgsql
pdo_sqlite pdo_sqlite

View File

@@ -6,6 +6,7 @@ bz2
calendar calendar
Core Core
ctype ctype
cubrid
curl curl
date date
dba dba
@@ -20,6 +21,7 @@ gettext
hash hash
iconv iconv
imagick imagick
ioncube
intl intl
json json
libxml libxml
@@ -33,6 +35,8 @@ openssl
pcntl pcntl
pcre pcre
PDO PDO
oci8
PDO_OCI
pdo_mysql pdo_mysql
pdo_pgsql pdo_pgsql
pdo_sqlite pdo_sqlite

View File

@@ -5,6 +5,7 @@ apcu
calendar calendar
Core Core
ctype ctype
cubrid
curl curl
date date
dom dom
@@ -17,6 +18,7 @@ gettext
hash hash
iconv iconv
igbinary igbinary
ioncube
intl intl
json json
libxml libxml

View File

@@ -4,6 +4,7 @@ apcu
calendar calendar
Core Core
ctype ctype
cubrid
curl curl
date date
dom dom
@@ -15,6 +16,7 @@ gettext
hash hash
iconv iconv
igbinary igbinary
ioncube
intl intl
json json
libxml libxml

View File

@@ -4,6 +4,7 @@ apcu
calendar calendar
Core Core
ctype ctype
cubrid
curl curl
date date
dom dom
@@ -15,6 +16,7 @@ gettext
hash hash
iconv iconv
igbinary igbinary
ioncube
intl intl
json json
libxml libxml

View File

@@ -4,6 +4,7 @@ apcu
calendar calendar
Core Core
ctype ctype
cubrid
curl curl
date date
dom dom
@@ -15,6 +16,7 @@ gettext
hash hash
iconv iconv
igbinary igbinary
ioncube
intl intl
json json
libxml libxml

View File

@@ -4,6 +4,7 @@ apcu
calendar calendar
Core Core
ctype ctype
cubrid
curl curl
date date
dom dom
@@ -15,6 +16,7 @@ gettext
hash hash
iconv iconv
igbinary igbinary
ioncube
intl intl
json json
libxml libxml

View File

@@ -1,47 +1,86 @@
[PHP Modules] [PHP Modules]
amqp amqp
apcu apcu
bcmath
bz2
calendar calendar
Core Core
ctype ctype
cubrid
curl
date date
dba
dom
enchant
exif exif
FFI FFI
fileinfo fileinfo
filter filter
ftp ftp
gd
gettext gettext
gmp
hash hash
iconv iconv
igbinary igbinary
imape
ioncube
intl
json json
ldap
libxml libxml
mbstring
memcache memcache
memcached memcached
mongodb mongodb
msgpack msgpack
mysqli
mysqlnd
odbc
openssl openssl
pcntl pcntl
pcov
pcre pcre
oci8
PDO PDO
pdo_dblib
PDO_Firebird
PDO_OCI
pdo_mysql
PDO_ODBC
pdo_pgsql
pdo_sqlite
pgsql
Phar Phar
posix posix
pspell
readline readline
redis redis
Reflection Reflection
session session
shmop shmop
SimpleXML
snmp
soap
sockets sockets
sodium sodium
SPL SPL
sqlite3
standard standard
sysvmsg sysvmsg
sysvsem sysvsem
sysvshm sysvshm
tidy
tokenizer tokenizer
xdebug xdebug
xml
xmlreader
xmlrpc
xmlwriter
xsl
yaml yaml
Zend OPcache Zend OPcache
zip
zlib zlib
zmq zmq
phalcon3 phalcon3

View File

@@ -1,4 +1,6 @@
[PHP Modules] [PHP Modules]
amqp
apcu
bcmath bcmath
bz2 bz2
calendar calendar
@@ -6,6 +8,7 @@ Core
ctype ctype
curl curl
date date
dba
dom dom
enchant enchant
exif exif
@@ -18,18 +21,30 @@ gettext
gmp gmp
hash hash
iconv iconv
igbinary
imap
intl intl
json json
ldap
libxml libxml
mbstring mbstring
memcache
memcached
mongodb
msgpack
mysqli mysqli
mysqlnd mysqlnd
odbc
openssl openssl
pcntl pcntl
pcov
pcre pcre
PDO PDO
oci8
PDO_OCI
pdo_dblib
PDO_Firebird
pdo_mysql pdo_mysql
PDO_ODBC
pdo_pgsql pdo_pgsql
pdo_sqlite pdo_sqlite
pgsql pgsql
@@ -37,12 +52,15 @@ Phar
posix posix
pspell pspell
readline readline
redis
Reflection Reflection
session session
shmop shmop
SimpleXML SimpleXML
snmp
soap soap
sockets sockets
sodium
SPL SPL
sqlite3 sqlite3
standard standard
@@ -51,18 +69,21 @@ sysvsem
sysvshm sysvshm
tidy tidy
tokenizer tokenizer
xdebug
xml xml
xmlreader xmlreader
xmlrpc
xmlwriter xmlwriter
xsl xsl
yaml
Zend OPcache Zend OPcache
zip zip
zlib zlib
zmq
ioncube
phalcon3 phalcon3
phalcon4 phalcon4
blackfire blackfire
[Zend Modules] [Zend Modules]
Xdebug
Zend OPcache Zend OPcache

View 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

View File

@@ -1,39 +1,54 @@
[PHP Modules] [PHP Modules]
amqp
apc apc
apcu apcu
bcmath bcmath
bz2 bz2
Core Core
ctype ctype
cubrid
curl curl
date date
dom dom
enchant
ereg ereg
exif exif
fileinfo fileinfo
filter filter
ftp ftp
gd gd
gettext
gmp
hash hash
iconv iconv
ioncube
intl intl
json json
ldap
libxml libxml
mbstring mbstring
mcrypt mcrypt
memcache
memcached memcached
mongo mongo
mongodb
mysql mysql
mysqli mysqli
mysqlnd mysqlnd
openssl openssl
pcntl pcntl
pcov
pcre pcre
PDO PDO
oci8
PDO_OCI
pdo_mysql pdo_mysql
pdo_pgsql
pdo_sqlite pdo_sqlite
pgsql
Phar Phar
posix posix
pspell
readline readline
redis redis
Reflection Reflection
@@ -64,4 +79,3 @@ blackfire
[Zend Modules] [Zend Modules]
Xdebug Xdebug

View File

@@ -6,6 +6,7 @@ bz2
calendar calendar
Core Core
ctype ctype
cubrid
curl curl
date date
dba dba
@@ -20,6 +21,7 @@ gettext
hash hash
iconv iconv
imagick imagick
ioncube
intl intl
json json
libxml libxml
@@ -33,6 +35,8 @@ openssl
pcntl pcntl
pcre pcre
PDO PDO
oci8
PDO_OCI
pdo_mysql pdo_mysql
pdo_pgsql pdo_pgsql
pdo_sqlite pdo_sqlite

View File

@@ -6,6 +6,7 @@ bz2
calendar calendar
Core Core
ctype ctype
cubrid
curl curl
date date
dba dba
@@ -20,6 +21,7 @@ gettext
hash hash
iconv iconv
imagick imagick
ioncube
intl intl
json json
libxml libxml
@@ -33,6 +35,8 @@ openssl
pcntl pcntl
pcre pcre
PDO PDO
oci8
PDO_OCI
pdo_mysql pdo_mysql
pdo_pgsql pdo_pgsql
pdo_sqlite pdo_sqlite

View File

@@ -7,6 +7,7 @@ bz2
calendar calendar
Core Core
ctype ctype
cubrid
curl curl
date date
dba dba
@@ -25,6 +26,7 @@ iconv
igbinary igbinary
imap imap
interbase interbase
ioncube
intl intl
json json
ldap ldap
@@ -47,6 +49,8 @@ pcre
PDO PDO
pdo_dblib pdo_dblib
PDO_Firebird PDO_Firebird
oci8
PDO_OCI
pdo_mysql pdo_mysql
PDO_ODBC PDO_ODBC
pdo_pgsql pdo_pgsql

View File

@@ -6,6 +6,7 @@ bz2
calendar calendar
Core Core
ctype ctype
cubrid
curl curl
date date
dba dba
@@ -23,6 +24,7 @@ iconv
igbinary igbinary
imap imap
interbase interbase
ioncube
intl intl
json json
ldap ldap
@@ -42,6 +44,8 @@ pcre
PDO PDO
pdo_dblib pdo_dblib
PDO_Firebird PDO_Firebird
oci8
PDO_OCI
pdo_mysql pdo_mysql
PDO_ODBC PDO_ODBC
pdo_pgsql pdo_pgsql

View File

@@ -6,6 +6,7 @@ bz2
calendar calendar
Core Core
ctype ctype
cubrid
curl curl
date date
dba dba
@@ -23,6 +24,7 @@ iconv
igbinary igbinary
imap imap
interbase interbase
ioncube
intl intl
json json
ldap ldap
@@ -42,6 +44,8 @@ pcre
PDO PDO
pdo_dblib pdo_dblib
PDO_Firebird PDO_Firebird
oci8
PDO_OCI
pdo_mysql pdo_mysql
PDO_ODBC PDO_ODBC
pdo_pgsql pdo_pgsql

View File

@@ -6,6 +6,7 @@ bz2
calendar calendar
Core Core
ctype ctype
cubrid
curl curl
date date
dba dba
@@ -23,6 +24,7 @@ iconv
igbinary igbinary
imap imap
interbase interbase
ioncube
intl intl
json json
ldap ldap
@@ -41,6 +43,8 @@ pcre
PDO PDO
pdo_dblib pdo_dblib
PDO_Firebird PDO_Firebird
oci8
PDO_OCI
pdo_mysql pdo_mysql
PDO_ODBC PDO_ODBC
pdo_pgsql pdo_pgsql

View File

@@ -6,6 +6,7 @@ bz2
calendar calendar
Core Core
ctype ctype
cubrid
curl curl
date date
dba dba
@@ -23,6 +24,7 @@ iconv
igbinary igbinary
imap imap
interbase interbase
ioncube
intl intl
json json
ldap ldap
@@ -41,6 +43,8 @@ pcre
PDO PDO
pdo_dblib pdo_dblib
PDO_Firebird PDO_Firebird
oci8
PDO_OCI
pdo_mysql pdo_mysql
PDO_ODBC PDO_ODBC
pdo_pgsql pdo_pgsql

View File

@@ -6,6 +6,7 @@ bz2
calendar calendar
Core Core
ctype ctype
cubrid
curl curl
date date
dba dba
@@ -23,6 +24,7 @@ hash
iconv iconv
igbinary igbinary
imap imap
ioncube
intl intl
json json
ldap ldap
@@ -41,6 +43,8 @@ pcre
PDO PDO
pdo_dblib pdo_dblib
PDO_Firebird PDO_Firebird
oci8
PDO_OCI
pdo_mysql pdo_mysql
PDO_ODBC PDO_ODBC
pdo_pgsql pdo_pgsql

View File

@@ -1,4 +1,6 @@
[PHP Modules] [PHP Modules]
amqp
apcu
bcmath bcmath
bz2 bz2
calendar calendar
@@ -6,6 +8,7 @@ Core
ctype ctype
curl curl
date date
dba
dom dom
enchant enchant
exif exif
@@ -18,18 +21,30 @@ gettext
gmp gmp
hash hash
iconv iconv
igbinary
imap
intl intl
json json
ldap
libxml libxml
mbstring mbstring
memcache
memcached
mongodb
msgpack
mysqli mysqli
mysqlnd mysqlnd
odbc
openssl openssl
pcntl pcntl
pcov
pcre pcre
PDO PDO
oci8
PDO_OCI
pdo_dblib
PDO_Firebird
pdo_mysql pdo_mysql
PDO_ODBC
pdo_pgsql pdo_pgsql
pdo_sqlite pdo_sqlite
pgsql pgsql
@@ -37,12 +52,15 @@ Phar
posix posix
pspell pspell
readline readline
redis
Reflection Reflection
session session
shmop shmop
SimpleXML SimpleXML
snmp
soap soap
sockets sockets
sodium
SPL SPL
sqlite3 sqlite3
standard standard
@@ -51,18 +69,21 @@ sysvsem
sysvshm sysvshm
tidy tidy
tokenizer tokenizer
xdebug
xml xml
xmlreader xmlreader
xmlrpc
xmlwriter xmlwriter
xsl xsl
yaml
Zend OPcache Zend OPcache
zip zip
zlib zlib
zmq
ioncube
phalcon3 phalcon3
phalcon4 phalcon4
blackfire blackfire
[Zend Modules] [Zend Modules]
Xdebug
Zend OPcache Zend OPcache

View 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

View File

@@ -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';
}
} }
} }

View File

@@ -2,7 +2,7 @@
"compilerOptions": { "compilerOptions": {
/* Basic Options */ /* Basic Options */
// "incremental": true, /* Enable incremental compilation */ // "incremental": true, /* Enable incremental compilation */
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ "target": "ES2019", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
// "allowJs": true, /* Allow javascript files to be compiled. */ // "allowJs": true, /* Allow javascript files to be compiled. */
// "checkJs": true, /* Report errors in .js files. */ // "checkJs": true, /* Report errors in .js files. */