All Projects → shivammathur → cache-extensions

shivammathur / cache-extensions

Licence: MIT license
📦 Cache PHP extensions in GitHub Actions

Programming Languages

shell
77523 projects
typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to cache-extensions

Setup Php
GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.
Stars: ✭ 1,945 (+6383.33%)
Mutual labels:  php-extensions, github-actions
SupportDocs
Generate help centers for your iOS apps. Hosted by GitHub and always up-to-date.
Stars: ✭ 135 (+350%)
Mutual labels:  github-actions
github-pr-diff-tree
🌲 This action provide a comment that displays the diff of the pull request in a tree format.
Stars: ✭ 31 (+3.33%)
Mutual labels:  github-actions
jacoco-badge-generator
Coverage badges, and pull request coverage checks, from JaCoCo reports in GitHub Actions
Stars: ✭ 53 (+76.67%)
Mutual labels:  github-actions
action-homebrew-bump-formula
⚙️ A GitHub Action to easily bump Homebrew formula on new release
Stars: ✭ 68 (+126.67%)
Mutual labels:  github-actions
mean-docker
A Mean stack (Angular 15.0.3, Expressjs 4.17.1, MongoDB) jump start project with support of docker.
Stars: ✭ 73 (+143.33%)
Mutual labels:  github-actions
cibuildwheel
🎡 Build Python wheels for all the platforms on CI with minimal configuration.
Stars: ✭ 1,350 (+4400%)
Mutual labels:  github-actions
cypress-gh-action-example
Example running Cypress tests inside GitHub Action
Stars: ✭ 29 (-3.33%)
Mutual labels:  github-actions
travis-ci-latex-pdf
Overview of different methods to build LaTeX with GitHub Actions or Travis-CI (idea by @jackolney but completely rewritten by @PHPirates and contributors).
Stars: ✭ 113 (+276.67%)
Mutual labels:  github-actions
action-branch-name
Github action to enforce naming convention on branch names
Stars: ✭ 53 (+76.67%)
Mutual labels:  github-actions
actions
Load secrets into GitHub Actions
Stars: ✭ 47 (+56.67%)
Mutual labels:  github-actions
action-detekt-all
Run detekt for all files
Stars: ✭ 25 (-16.67%)
Mutual labels:  github-actions
action-hexo
No description or website provided.
Stars: ✭ 28 (-6.67%)
Mutual labels:  github-actions
githubsecrets
Manage your GitHub Actions secrets with a simple CLI
Stars: ✭ 41 (+36.67%)
Mutual labels:  github-actions
go-starter
Go 服务框架脚手架. 整合 echo、swag、viper、nsq、logrus、fx、xorm、cobra 等第三方库
Stars: ✭ 145 (+383.33%)
Mutual labels:  github-actions
actions
Our Library of GitHub Actions
Stars: ✭ 49 (+63.33%)
Mutual labels:  github-actions
clang-format-action
GitHub Action for clang-format checking
Stars: ✭ 48 (+60%)
Mutual labels:  github-actions
restrict-cursing-action
Github Action to prevent cursing and bad language in issues and pull requests
Stars: ✭ 20 (-33.33%)
Mutual labels:  github-actions
action-github-workflow-sync
Github Action To Sync Github Action's Workflow Files Across Repositories
Stars: ✭ 51 (+70%)
Mutual labels:  github-actions
gedoor-Build
在线编译你自己的阅读APP,自动构建,自动发布
Stars: ✭ 118 (+293.33%)
Mutual labels:  github-actions

Cache PHP extensions in GitHub Actions

GitHub Actions status Codecov Code Coverage LICENSE PHP Versions Supported

Cache PHP extensions in GitHub Actions. This action has to be used along with shivammathur/setup-php and actions/cache GitHub Actions. It configures the environment required to cache PHP extensions. Refer to Usage section for details and example workflow.

Contents

🎉 PHP Support

PHP Version Stability Release Support
5.3 Stable End of life
5.4 Stable End of life
5.5 Stable End of life
5.6 Stable End of life
7.0 Stable End of life
7.1 Stable End of life
7.2 Stable End of life
7.3 Stable End of life
7.4 Stable Security fixes only
8.0 Stable Active
8.1 Stable Active
8.2 Nightly In development

☁️ OS/Platform Support

Virtual environment YAML workflow label
Ubuntu 22.04 ubuntu-22.04
Ubuntu 20.04 ubuntu-latest or ubuntu-20.04
Ubuntu 18.04 ubuntu-18.04
Windows Server 2022 windows-2022
Windows Server 2019 windows-latest or windows-2019
macOS Big Sur 12.x macOS-12
macOS Big Sur 11.x macos-latest or macOS-11

📝 Usage

Use this GitHub Action when the extensions you are adding in setup-php 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

php-version (required)

  • Specify the PHP version you want to set up.
  • Accepts a string. For example '8.2'.
  • Accepts latest to set up the latest stable PHP version.
  • Accepts nightly to set up a nightly build from the master branch of PHP.
  • Accepts the format d.x, where d is the major version. For example 5.x, 7.x and 8.x.
  • See PHP support for supported PHP versions.

extensions (required)

  • Specify the extensions you want to set up.
  • Accepts a string in csv-format. For example mbstring, xdebug, :opcache.
  • Extensions prefixed with : are ignored in output cache key.

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 and usage below for more info.

Workflow

Cache extensions in a PHP workflow

jobs:
  run:
    runs-on: ${{ matrix.operating-system }}
    strategy:
      matrix:
        operating-system: [ubuntu-latest, windows-latest, macos-latest]
        php-versions: ['7.4', '8.0', '8.1', '8.2']
    name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
    env:
      extensions: intl, pcov
      key: cache-v1 # can be any string, change to clear the extension cache.
    steps:
    - name: Checkout
      uses: actions/checkout@v3

    - name: Setup cache environment
      id: extcache
      uses: shivammathur/cache-extensions@v1
      with:
        php-version: ${{ matrix.php-versions }}
        extensions: ${{ env.extensions }}
        key: ${{ env.key }}

    - name: Cache extensions
      uses: actions/cache@v2
      with:
        path: ${{ steps.extcache.outputs.dir }}
        key: ${{ steps.extcache.outputs.key }}
        restore-keys: ${{ steps.extcache.outputs.key }}

    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: ${{ matrix.php-versions }}
        extensions: ${{ env.extensions }}

Thread Safe Setup

If you set up both TS and NTS PHP versions on Ubuntu or 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.

- 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 }}

📜 License

The code and documentation in this project are under the MIT License. This project has multiple dependencies. Their licenses can be found in their respective repositories.

👍 Contributions

Contributions are welcome! See Contributor's Guide. If you face any issues while using this or want to suggest a feature/improvement, create an issue here.

💖 Support This Project

If this action helped you.

  • Please star the project and share it. If you blog, please share your experience of using this action.
  • Please support our work by sponsoring using GitHub sponsors.

📦 Dependencies

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].