Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/actions/setup-go/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: setup-go
description: Setup Go using the version from go.mod, with standard cache configuration
inputs:
working-directory:
description: Path prefix for go.mod / go.sum files (used when the repo is checked out into a subdirectory)
required: false
default: "."
Comment thread
dunglas marked this conversation as resolved.
Comment thread
dunglas marked this conversation as resolved.
Comment thread
dunglas marked this conversation as resolved.
runs:
using: composite
steps:
Comment thread
dunglas marked this conversation as resolved.
- uses: actions/setup-go@v6
with:
go-version-file: ${{ inputs.working-directory }}/go.mod
cache-dependency-path: |
${{ inputs.working-directory }}/go.sum
${{ inputs.working-directory }}/caddy/go.sum
cache: ${{ !startsWith(github.ref, 'refs/tags/') }}
Comment thread
dunglas marked this conversation as resolved.
check-latest: true
19 changes: 19 additions & 0 deletions .github/actions/setup-php/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: setup-php
description: Setup PHP in ZTS + debug mode with FrankenPHP's standard configuration
inputs:
php-version:
description: PHP version (e.g. "8.5")
required: false
default: "8.5"
runs:
using: composite
steps:
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ inputs.php-version }}
ini-file: development
coverage: none
tools: none
env:
phpts: ts
debug: true
26 changes: 26 additions & 0 deletions .github/actions/version/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: version
description: Resolve FRANKENPHP_VERSION from the current ref (stripped tag name, with commit SHA fallback)
inputs:
ref:
description: Optional ref override (e.g. tag name resolved by a prepare job for schedule/dispatch flows)
required: false
default: ""
runs:
using: composite
steps:
- shell: bash
env:
REF: ${{ inputs.ref }}
run: | # zizmor: ignore[github-env]
if [ "${GITHUB_REF_TYPE}" = "tag" ]; then
version="${GITHUB_REF_NAME#v}"
elif [ -n "${REF}" ]; then
version="${REF#v}"
else
version="${GITHUB_SHA}"
fi
if [[ ! "${version}" =~ ^[A-Za-z0-9._-]+$ ]]; then
echo "::error::invalid FRANKENPHP_VERSION value: ${version}" >&2
exit 1
fi
echo "FRANKENPHP_VERSION=${version}" >> "${GITHUB_ENV}"
17 changes: 2 additions & 15 deletions .github/workflows/pgo-profile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,8 @@ jobs:
# zizmor: ignore[artipacked]
# persist-credentials is intentionally left enabled because this
# workflow needs to push a branch via git push (mirrors translate.yaml).
- uses: actions/setup-go@v6
with:
go-version: "1.26"
cache-dependency-path: |
go.sum
caddy/go.sum
- uses: shivammathur/setup-php@v2
with:
php-version: "8.5"
ini-file: development
coverage: none
tools: none
env:
phpts: ts
debug: true
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/setup-php
- name: Install e-dant/watcher
uses: ./.github/actions/watcher
- name: Set CGO flags
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/sanitizers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,7 @@ jobs:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-go@v6
with:
go-version: "1.26"
cache-dependency-path: |
go.sum
caddy/go.sum
- uses: ./.github/actions/setup-go
- name: Determine PHP version
id: determine-php-version
run: |
Expand Down
24 changes: 4 additions & 20 deletions .github/workflows/static.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -452,26 +452,10 @@ jobs:
with:
ref: ${{ needs.prepare.outputs.ref }}
persist-credentials: false
- uses: actions/setup-go@v6
with: # zizmor: ignore[cache-poisoning]
go-version: "1.26"
cache-dependency-path: |
go.sum
caddy/go.sum
cache: ${{ github.event_name != 'release' }}
- name: Set FRANKENPHP_VERSION
run: |
if [ "${GITHUB_REF_TYPE}" == "tag" ]; then
export FRANKENPHP_VERSION=${GITHUB_REF_NAME:1}
elif [ "${GITHUB_EVENT_NAME}" == "schedule" ]; then
export FRANKENPHP_VERSION="${REF}"
else
export FRANKENPHP_VERSION=${GITHUB_SHA}
fi

echo "FRANKENPHP_VERSION=${FRANKENPHP_VERSION}" >> "${GITHUB_ENV}"
env:
REF: ${{ needs.prepare.outputs.ref }}
- uses: ./.github/actions/setup-go
Comment thread
dunglas marked this conversation as resolved.
- uses: ./.github/actions/version
with:
ref: ${{ needs.prepare.outputs.ref }}
- name: Build FrankenPHP
run: ./build-static.sh
env:
Expand Down
47 changes: 6 additions & 41 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,10 @@ jobs:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-go@v6
with:
go-version: "1.26"
cache-dependency-path: |
go.sum
caddy/go.sum
- uses: shivammathur/setup-php@v2
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/setup-php
with:
php-version: ${{ matrix.php-versions }}
ini-file: development
coverage: none
tools: none
env:
phpts: ts
debug: true
- name: Install e-dant/watcher
uses: ./.github/actions/watcher
- name: Reinstall libbrotli-dev
Expand Down Expand Up @@ -117,21 +106,10 @@ jobs:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-go@v6
with:
go-version: "1.26"
cache-dependency-path: |
go.sum
caddy/go.sum
- uses: shivammathur/setup-php@v2
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/setup-php
with:
php-version: ${{ matrix.php-versions }}
ini-file: development
coverage: none
tools: none
env:
phpts: ts
debug: true
- name: Install PHP development libraries
run: sudo apt-get update && sudo apt-get install -y libkrb5-dev libsodium-dev libargon2-dev
- name: Install xcaddy
Expand Down Expand Up @@ -161,21 +139,8 @@ jobs:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-go@v6
with:
go-version: "1.26"
cache-dependency-path: |
go.sum
caddy/go.sum
- uses: shivammathur/setup-php@v2
with:
php-version: 8.5
ini-file: development
coverage: none
tools: none
env:
phpts: ts
debug: true
- uses: ./.github/actions/setup-go
- uses: ./.github/actions/setup-php
- name: Install gotestsum
run: go install gotest.tools/gotestsum@latest
- name: Set CGO flags
Expand Down
31 changes: 6 additions & 25 deletions .github/workflows/windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,33 +69,14 @@ jobs:
path: frankenphp
persist-credentials: false

- name: Set FRANKENPHP_VERSION
run: |
$ref = $env:REF

if ($env:GITHUB_REF_TYPE -eq "tag") {
$frankenphpVersion = $env:GITHUB_REF_NAME.Substring(1)
} elseif ($ref) {
if ($ref.StartsWith("v")) {
$frankenphpVersion = $ref.Substring(1)
} else {
$frankenphpVersion = $ref
}
} else {
$frankenphpVersion = $env:GITHUB_SHA
}

"FRANKENPHP_VERSION=$frankenphpVersion" >> $env:GITHUB_ENV
- uses: ./frankenphp/.github/actions/version
with:
ref: ${{ env.REF }}

- name: Setup Go
uses: actions/setup-go@v6
with: # zizmor: ignore[cache-poisoning]
go-version: "1.26"
cache-dependency-path: |
frankenphp/go.sum
frankenphp/caddy/go.sum
cache: ${{ !startsWith(github.ref, 'refs/tags/') }}
check-latest: true
uses: ./frankenphp/.github/actions/setup-go
with:
working-directory: frankenphp

- name: Install Vcpkg Libraries
working-directory: frankenphp
Expand Down
Loading