Skip to content

Commit

Permalink
Update actions (#428)
Browse files Browse the repository at this point in the history
* Update action versions

* Use same dependency cache key naming logic

Bring consistency across the whole pipeline
  • Loading branch information
simonhamp authored Apr 29, 2024
1 parent 7a8e0a7 commit 15c2935
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 35 deletions.
32 changes: 24 additions & 8 deletions .github/workflows/build-linux-arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,30 @@ jobs:
name: build ${{ inputs.version }} on ${{ inputs.operating-system }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- 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
- id: cache-download
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: downloads
key: php-${{ inputs.version }}-dependencies-${{ inputs.extensions }}
key: php-${{ env.INPUT_HASH }}

# With or without debug
- if: inputs.debug == true
Expand All @@ -75,31 +91,31 @@ jobs:

# Upload cli executable
- if: ${{ inputs.build-cli == true }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: php-${{ inputs.version }}-linux-${{ inputs.operating-system }}
path: buildroot/bin/php

# Upload micro self-extracted executable
- if: ${{ inputs.build-micro == true }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: micro-${{ inputs.version }}-linux-${{ inputs.operating-system }}
path: buildroot/bin/micro.sfx

# Upload fpm executable
- if: ${{ inputs.build-fpm == true }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: php-fpm-${{ inputs.version }}-linux-${{ inputs.operating-system }}
path: buildroot/bin/php-fpm

# Upload extensions metadata
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: license-files
path: buildroot/license/
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: build-meta
path: |
Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/build-linux-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ jobs:
name: build ${{ inputs.version }} on Linux x86_64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Cache composer dependencies
- id: cache-composer-deps
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: vendor
key: composer-dependencies
Expand All @@ -52,12 +52,17 @@ jobs:
- 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
- id: cache-download
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: downloads
key: php-${{ inputs.version }}-dependencies-${{ inputs.extensions }}
key: php-${{ env.INPUT_HASH }}

# With or without debug
- if: inputs.debug == true
Expand All @@ -80,31 +85,31 @@ jobs:

# Upload cli executable
- if: ${{ inputs.build-cli == true }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: php-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
path: buildroot/bin/php

# Upload micro self-extracted executable
- if: ${{ inputs.build-micro == true }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: micro-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
path: buildroot/bin/micro.sfx

# Upload fpm executable
- if: ${{ inputs.build-fpm == true }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: php-fpm-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
path: buildroot/bin/php-fpm

# Upload extensions metadata
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: license-files
path: buildroot/license/
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: build-meta
path: |
Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/build-macos-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
name: build ${{ inputs.version }} on macOS arm64
runs-on: macos-14
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Install macOS missing packages and mark os suffix
- run: |
Expand All @@ -58,7 +58,7 @@ jobs:

# Cache composer dependencies
- id: cache-composer-deps
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: vendor
key: composer-dependencies
Expand All @@ -67,12 +67,17 @@ jobs:
- 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
- id: cache-download
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: downloads
key: php-${{ inputs.version }}-dependencies-${{ inputs.extensions }}
key: php-${{ env.INPUT_HASH }}

# With or without debug
- if: inputs.debug == true
Expand All @@ -95,31 +100,31 @@ jobs:

# Upload cli executable
- if: ${{ inputs.build-cli == true }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: php-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
path: buildroot/bin/php

# Upload micro self-extracted executable
- if: ${{ inputs.build-micro == true }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: micro-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
path: buildroot/bin/micro.sfx

# Upload fpm executable
- if: ${{ inputs.build-fpm == true }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: php-fpm-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
path: buildroot/bin/php-fpm

# Upload extensions metadata
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: license-files
path: buildroot/license/
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: build-meta
path: |
Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/build-macos-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
name: build ${{ inputs.version }} on macOS x86_64
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# Install macOS missing packages and mark os suffix
- run: |
Expand All @@ -56,7 +56,7 @@ jobs:

# Cache composer dependencies
- id: cache-composer-deps
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: vendor
key: composer-dependencies
Expand All @@ -65,12 +65,17 @@ jobs:
- 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
- id: cache-download
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: downloads
key: php-${{ inputs.version }}-dependencies-${{ inputs.extensions }}
key: php-${{ env.INPUT_HASH }}

# With or without debug
- if: inputs.debug == true
Expand All @@ -93,31 +98,31 @@ jobs:

# Upload cli executable
- if: ${{ inputs.build-cli == true }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: php-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
path: buildroot/bin/php

# Upload micro self-extracted executable
- if: ${{ inputs.build-micro == true }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: micro-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
path: buildroot/bin/micro.sfx

# Upload fpm executable
- if: ${{ inputs.build-fpm == true }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: php-fpm-${{ inputs.version }}-${{ env.SPC_BUILD_OS }}
path: buildroot/bin/php-fpm

# Upload extensions metadata
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: license-files
path: buildroot/license/
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: build-meta
path: |
Expand Down

0 comments on commit 15c2935

Please sign in to comment.