mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-12 11:25:35 +08:00
Use same dependency cache key naming logic
Bring consistency across the whole pipeline
This commit is contained in:
18
.github/workflows/build-linux-arm.yml
vendored
18
.github/workflows/build-linux-arm.yml
vendored
@@ -47,12 +47,28 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
# Cache composer dependencies
|
||||||
|
- id: cache-composer-deps
|
||||||
|
uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: vendor
|
||||||
|
key: composer-dependencies
|
||||||
|
|
||||||
|
# If there's no Composer cache, install dependencies
|
||||||
|
- if: steps.cache-composer-deps.outputs.cache-hit != 'true'
|
||||||
|
run: composer update --no-dev --classmap-authoritative
|
||||||
|
|
||||||
|
- name: Generate hashed key for download cache
|
||||||
|
run: |
|
||||||
|
INPUT_HASH=$(echo "${{ runner.os }}-${{ inputs.version }}-${{ inputs.extensions }}" | sha256sum | awk '{print $1}')
|
||||||
|
echo "INPUT_HASH=${INPUT_HASH}" >> $GITHUB_ENV
|
||||||
|
|
||||||
# Cache downloaded source
|
# Cache downloaded source
|
||||||
- id: cache-download
|
- id: cache-download
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: downloads
|
path: downloads
|
||||||
key: php-${{ inputs.version }}-dependencies-${{ inputs.extensions }}
|
key: php-${{ env.INPUT_HASH }}
|
||||||
|
|
||||||
# With or without debug
|
# With or without debug
|
||||||
- if: inputs.debug == true
|
- if: inputs.debug == true
|
||||||
|
|||||||
7
.github/workflows/build-linux-x86_64.yml
vendored
7
.github/workflows/build-linux-x86_64.yml
vendored
@@ -52,12 +52,17 @@ jobs:
|
|||||||
- if: steps.cache-composer-deps.outputs.cache-hit != 'true'
|
- if: steps.cache-composer-deps.outputs.cache-hit != 'true'
|
||||||
run: composer update --no-dev --classmap-authoritative
|
run: composer update --no-dev --classmap-authoritative
|
||||||
|
|
||||||
|
- name: Generate hashed key for download cache
|
||||||
|
run: |
|
||||||
|
INPUT_HASH=$(echo "${{ runner.os }}-${{ inputs.version }}-${{ inputs.extensions }}" | sha256sum | awk '{print $1}')
|
||||||
|
echo "INPUT_HASH=${INPUT_HASH}" >> $GITHUB_ENV
|
||||||
|
|
||||||
# Cache downloaded source
|
# Cache downloaded source
|
||||||
- id: cache-download
|
- id: cache-download
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: downloads
|
path: downloads
|
||||||
key: php-${{ inputs.version }}-dependencies-${{ inputs.extensions }}
|
key: php-${{ env.INPUT_HASH }}
|
||||||
|
|
||||||
# With or without debug
|
# With or without debug
|
||||||
- if: inputs.debug == true
|
- if: inputs.debug == true
|
||||||
|
|||||||
7
.github/workflows/build-macos-aarch64.yml
vendored
7
.github/workflows/build-macos-aarch64.yml
vendored
@@ -67,12 +67,17 @@ jobs:
|
|||||||
- if: steps.cache-composer-deps.outputs.cache-hit != 'true'
|
- if: steps.cache-composer-deps.outputs.cache-hit != 'true'
|
||||||
run: composer update --no-dev --classmap-authoritative
|
run: composer update --no-dev --classmap-authoritative
|
||||||
|
|
||||||
|
- name: Generate hashed key for download cache
|
||||||
|
run: |
|
||||||
|
INPUT_HASH=$(echo "${{ runner.os }}-${{ inputs.version }}-${{ inputs.extensions }}" | sha256sum | awk '{print $1}')
|
||||||
|
echo "INPUT_HASH=${INPUT_HASH}" >> $GITHUB_ENV
|
||||||
|
|
||||||
# Cache downloaded source
|
# Cache downloaded source
|
||||||
- id: cache-download
|
- id: cache-download
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: downloads
|
path: downloads
|
||||||
key: php-${{ inputs.version }}-dependencies-${{ inputs.extensions }}
|
key: php-${{ env.INPUT_HASH }}
|
||||||
|
|
||||||
# With or without debug
|
# With or without debug
|
||||||
- if: inputs.debug == true
|
- if: inputs.debug == true
|
||||||
|
|||||||
7
.github/workflows/build-macos-x86_64.yml
vendored
7
.github/workflows/build-macos-x86_64.yml
vendored
@@ -57,12 +57,17 @@ jobs:
|
|||||||
- if: steps.cache-composer-deps.outputs.cache-hit != 'true'
|
- if: steps.cache-composer-deps.outputs.cache-hit != 'true'
|
||||||
run: composer update --no-dev --classmap-authoritative
|
run: composer update --no-dev --classmap-authoritative
|
||||||
|
|
||||||
|
- name: Generate hashed key for download cache
|
||||||
|
run: |
|
||||||
|
INPUT_HASH=$(echo "${{ runner.os }}-${{ inputs.version }}-${{ inputs.extensions }}" | sha256sum | awk '{print $1}')
|
||||||
|
echo "INPUT_HASH=${INPUT_HASH}" >> $GITHUB_ENV
|
||||||
|
|
||||||
# Cache downloaded source
|
# Cache downloaded source
|
||||||
- id: cache-download
|
- id: cache-download
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: downloads
|
path: downloads
|
||||||
key: php-${{ inputs.version }}-dependencies-${{ inputs.extensions }}
|
key: php-${{ env.INPUT_HASH }}
|
||||||
|
|
||||||
# With or without debug
|
# With or without debug
|
||||||
- if: inputs.debug == true
|
- if: inputs.debug == true
|
||||||
|
|||||||
Reference in New Issue
Block a user