From 4b7a01ee7a7c235e44d7a4167e2d6b3ba19da8bb Mon Sep 17 00:00:00 2001 From: Refringe Date: Wed, 29 Jan 2025 17:51:25 -0500 Subject: [PATCH] Fixes issues in custom CI action --- .github/action/setup/action.yml | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/action/setup/action.yml b/.github/action/setup/action.yml index b46c9d7..5e641a1 100644 --- a/.github/action/setup/action.yml +++ b/.github/action/setup/action.yml @@ -1,42 +1,49 @@ name: Setup -description: 'Setup PHP, Composer, and NPM.' +description: Setup and Cache PHP, Composer, and NPM. inputs: php-version: - description: 'PHP version(s) to use.' + description: PHP version(s) to use. required: true php-extensions: - description: 'PHP extensions to install.' + description: PHP extensions to install. required: false default: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, redis, igbinary, msgpack, memcached, gmp, :php-psr redis-options: - description: 'Redis options to compile with.' + description: Redis options to compile with. required: false default: --enable-redis --enable-redis-igbinary --enable-redis-msgpack --enable-redis-lzf --with-liblzf --enable-redis-zstd --with-libzstd --enable-redis-lz4 --with-liblz4 redis-libs: - description: 'Redis libraries to install.' + description: Redis libraries to install. required: false default: liblz4-dev, liblzf-dev, libzstd-dev + runs: using: composite steps: - name: Get PHP Extension Cache Hash id: php-ext-cache-hash + with: + PHP_EXTENSIONS: ${{ inputs.php-extensions }} + REDIS_OPTIONS: ${{ inputs.redis-options }} + REDIS_LIBS: ${{ inputs.redis-libs }} run: | - concat_values="${PHP_EXTENSIONS}${REDIS_CONFIGURE_OPTS}${REDIS_LIBS}" + concat_values="${PHP_EXTENSIONS}${REDIS_OPTIONS}${REDIS_LIBS}" echo hash=$(echo $concat_values | md5sum | awk '{print $1}') >> $GITHUB_OUTPUT shell: bash - name: Setup Cache Environment id: php-ext-cache uses: shivammathur/cache-extensions@v1 + if: inputs.php-extensions == true && inputs.redis-options == true && inputs.redis-libs == true with: - php-version: ${{ input.php-version }} - extensions: ${{ input.php-extensions }} + php-version: ${{ inputs.php-version }} + extensions: ${{ inputs.php-extensions }} key: ${{ runner.os }}-php-ext-${{ steps.php-ext-cache-hash.outputs.hash }} - name: Cache PHP Extensions uses: actions/cache@v4 + if: inputs.php-extensions == true && inputs.redis-options == true && inputs.redis-libs == true with: path: ${{ steps.php-ext-cache.outputs.dir }} key: ${{ steps.php-ext-cache.outputs.key }} @@ -45,14 +52,14 @@ runs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: ${{ input.php-version }} - extensions: ${{ input.php-extensions }} + php-version: ${{ inputs.php-version }} + extensions: ${{ inputs.php-extensions }} ini-values: error_reporting=E_ALL tools: composer:v2 coverage: none env: - REDIS_CONFIGURE_OPTS: ${{ input.redis-options }} - REDIS_LIBS: liblz4-dev, liblzf-dev, libzstd-dev + REDIS_CONFIGURE_OPTS: ${{ inputs.redis-options }} + REDIS_LIBS: ${{ inputs.redis-libs }} - name: Get Composer Cache Directory id: composer-cache