From 51d98877496931aa08ae8c4ce22dfa4cc1f0d676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Fri, 7 Aug 2026 17:15:26 +0000 Subject: [PATCH 1/3] ci: run independent steps in parallel GitHub Actions now supports running job steps concurrently via the parallel key. Group independent lint/tidy checks, Windows dependency downloads, and Docker metadata uploads so each job's wall time drops to the slowest step in the group instead of their sum. --- .github/workflows/docker.yaml | 33 ++++++++++--------- .github/workflows/tests.yaml | 37 ++++++++++----------- .github/workflows/windows.yaml | 59 +++++++++++++++++----------------- 3 files changed, 66 insertions(+), 63 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index e7ee3c98db..0092f62a1f 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -194,22 +194,23 @@ jobs: env: METADATA: ${{ steps.build.outputs.metadata }} VARIANT: ${{ matrix.variant }} - - name: Upload builder metadata - if: fromJson(needs.prepare.outputs.push) - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: metadata-builder-${{ matrix.variant }}-${{ steps.prepare.outputs.sanitized_platform }} - path: /tmp/metadata/builder/* - if-no-files-found: error - retention-days: 1 - - name: Upload runner metadata - if: fromJson(needs.prepare.outputs.push) - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: metadata-runner-${{ matrix.variant }}-${{ steps.prepare.outputs.sanitized_platform }} - path: /tmp/metadata/runner/* - if-no-files-found: error - retention-days: 1 + - parallel: + - name: Upload builder metadata + if: fromJson(needs.prepare.outputs.push) + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: metadata-builder-${{ matrix.variant }}-${{ steps.prepare.outputs.sanitized_platform }} + path: /tmp/metadata/builder/* + if-no-files-found: error + retention-days: 1 + - name: Upload runner metadata + if: fromJson(needs.prepare.outputs.push) + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: metadata-runner-${{ matrix.variant }}-${{ steps.prepare.outputs.sanitized_platform }} + path: /tmp/metadata/runner/* + if-no-files-found: error + retention-days: 1 - name: Run tests if: ${{ !fromJson(needs.prepare.outputs.push) }} run: | diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 8b0759f7a6..2fda88c205 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -75,24 +75,25 @@ jobs: run: sudo ../caddy/frankenphp/frankenphp start - name: Run integrations tests run: ./reload_test.sh - - name: Lint Go code - uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 - if: matrix.php-versions == '8.5' - with: - version: latest - - name: Lint Caddy module Go code - uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 - if: matrix.php-versions == '8.5' - with: - version: latest - working-directory: caddy/ - - name: Ensure go.mod is tidy - if: matrix.php-versions == '8.5' - run: go mod tidy -diff - - name: Ensure caddy/go.mod is tidy - if: matrix.php-versions == '8.5' - run: go mod tidy -diff - working-directory: caddy/ + - parallel: + - name: Lint Go code + uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 + if: matrix.php-versions == '8.5' + with: + version: latest + - name: Lint Caddy module Go code + uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 + if: matrix.php-versions == '8.5' + with: + version: latest + working-directory: caddy/ + - name: Ensure go.mod is tidy + if: matrix.php-versions == '8.5' + run: go mod tidy -diff + - name: Ensure caddy/go.mod is tidy + if: matrix.php-versions == '8.5' + run: go mod tidy -diff + working-directory: caddy/ integration-tests: name: Integration Tests (Linux, PHP ${{ matrix.php-versions }}) runs-on: ubuntu-latest diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index fd238306ca..91efd465e4 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -82,48 +82,49 @@ jobs: with: working-directory: frankenphp - - name: Install Vcpkg Libraries - working-directory: frankenphp - run: "vcpkg install" + - parallel: + - name: Install Vcpkg Libraries + working-directory: frankenphp + run: "vcpkg install" - - name: Download Watcher - run: | - $latestTag = gh release list --repo e-dant/watcher --limit 1 --exclude-drafts --exclude-pre-releases --json tagName --jq '.[0].tagName' - Write-Host "Latest Watcher version: $latestTag" + - name: Download Watcher + run: | + $latestTag = gh release list --repo e-dant/watcher --limit 1 --exclude-drafts --exclude-pre-releases --json tagName --jq '.[0].tagName' + Write-Host "Latest Watcher version: $latestTag" - gh release download $latestTag --repo e-dant/watcher --pattern "*x86_64-pc-windows-msvc.tar" -O watcher.tar + gh release download $latestTag --repo e-dant/watcher --pattern "*x86_64-pc-windows-msvc.tar" -O watcher.tar - tar -xf "watcher.tar" -C "$env:GITHUB_WORKSPACE" - Rename-Item -Path "$env:GITHUB_WORKSPACE\x86_64-pc-windows-msvc" -NewName "watcher" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + tar -xf "watcher.tar" -C "$env:GITHUB_WORKSPACE" + Rename-Item -Path "$env:GITHUB_WORKSPACE\x86_64-pc-windows-msvc" -NewName "watcher" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Download PHP - run: | - $webContent = Invoke-WebRequest -Uri $env:PHP_DOWNLOAD_BASE - $links = $webContent.Links.Href | Where-Object { $_ -match "php-\d+\.\d+\.\d+-Win32-vs17-x64\.zip$" } + - name: Download PHP + run: | + $webContent = Invoke-WebRequest -Uri $env:PHP_DOWNLOAD_BASE + $links = $webContent.Links.Href | Where-Object { $_ -match "php-\d+\.\d+\.\d+-Win32-vs17-x64\.zip$" } - if (-not $links) { throw "Could not find PHP zip files at $env:PHP_DOWNLOAD_BASE" } + if (-not $links) { throw "Could not find PHP zip files at $env:PHP_DOWNLOAD_BASE" } - $latestFile = $links | Sort-Object { if ($_ -match '(\d+\.\d+\.\d+)') { [version]$matches[1] } } | Select-Object -Last 1 + $latestFile = $links | Sort-Object { if ($_ -match '(\d+\.\d+\.\d+)') { [version]$matches[1] } } | Select-Object -Last 1 - $version = if ($latestFile -match '(\d+\.\d+\.\d+)') { $matches[1] } - Write-Host "Detected latest PHP version: $version" + $version = if ($latestFile -match '(\d+\.\d+\.\d+)') { $matches[1] } + Write-Host "Detected latest PHP version: $version" - "PHP_VERSION=$version" >> $env:GITHUB_ENV + "PHP_VERSION=$version" >> $env:GITHUB_ENV - $phpZip = "php-$version-Win32-vs17-x64.zip" - $develZip = "php-devel-pack-$version-Win32-vs17-x64.zip" + $phpZip = "php-$version-Win32-vs17-x64.zip" + $develZip = "php-devel-pack-$version-Win32-vs17-x64.zip" - $dirName = "frankenphp-windows-x86_64" + $dirName = "frankenphp-windows-x86_64" - "DIR_NAME=$dirName" >> $env:GITHUB_ENV + "DIR_NAME=$dirName" >> $env:GITHUB_ENV - Invoke-WebRequest -Uri "$env:PHP_DOWNLOAD_BASE/$phpZip" -OutFile "$env:TEMP\php.zip" - Expand-Archive -Path "$env:TEMP\php.zip" -DestinationPath "$env:GITHUB_WORKSPACE\$dirName" + Invoke-WebRequest -Uri "$env:PHP_DOWNLOAD_BASE/$phpZip" -OutFile "$env:TEMP\php.zip" + Expand-Archive -Path "$env:TEMP\php.zip" -DestinationPath "$env:GITHUB_WORKSPACE\$dirName" - Invoke-WebRequest -Uri "$env:PHP_DOWNLOAD_BASE/$develZip" -OutFile "$env:TEMP\php-devel.zip" - Expand-Archive -Path "$env:TEMP\php-devel.zip" -DestinationPath "$env:GITHUB_WORKSPACE\php-devel" + Invoke-WebRequest -Uri "$env:PHP_DOWNLOAD_BASE/$develZip" -OutFile "$env:TEMP\php-devel.zip" + Expand-Archive -Path "$env:TEMP\php-devel.zip" -DestinationPath "$env:GITHUB_WORKSPACE\php-devel" - name: Prepare env run: | From 3490b258f02dde6989f2b395752fadafce282456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Fri, 7 Aug 2026 18:20:37 +0000 Subject: [PATCH 2/3] ci: fix CI regressions from parallel-steps change golangci-lint holds a lock across concurrent runs on the same machine and errors out rather than serializing ("parallel golangci-lint is running"), so keep the two lint steps sequential and only parallelize the two independent go.mod tidy checks. actionlint (bundled in super-linter v8.7.0) doesn't recognize the new "parallel" step key yet and fails the syntax check, so disable VALIDATE_GITHUB_ACTIONS until it's updated. --- .github/workflows/lint.yaml | 2 ++ .github/workflows/tests.yaml | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index d49ac91fe0..1f35b6ee60 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -35,6 +35,8 @@ jobs: VALIDATE_JSCPD: false VALIDATE_GO: false VALIDATE_GO_MODULES: false + # actionlint (super-linter v8.7.0) doesn't know the "parallel" step key yet; re-enable once it does + VALIDATE_GITHUB_ACTIONS: false VALIDATE_PHP_PHPCS: false VALIDATE_PHP_PHPSTAN: false VALIDATE_PHP_PSALM: false diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 2fda88c205..ef517556ca 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -75,18 +75,18 @@ jobs: run: sudo ../caddy/frankenphp/frankenphp start - name: Run integrations tests run: ./reload_test.sh + - name: Lint Go code + uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 + if: matrix.php-versions == '8.5' + with: + version: latest + - name: Lint Caddy module Go code + uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 + if: matrix.php-versions == '8.5' + with: + version: latest + working-directory: caddy/ - parallel: - - name: Lint Go code - uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 - if: matrix.php-versions == '8.5' - with: - version: latest - - name: Lint Caddy module Go code - uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9.3.0 - if: matrix.php-versions == '8.5' - with: - version: latest - working-directory: caddy/ - name: Ensure go.mod is tidy if: matrix.php-versions == '8.5' run: go mod tidy -diff From e02eb850e7a2723b9dbf0238ed76770a5248c6a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Fri, 7 Aug 2026 18:20:55 +0000 Subject: [PATCH 3/3] ci: link actionlint tracking issue for parallel step support --- .github/workflows/lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 1f35b6ee60..15f6d4efa3 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -35,7 +35,7 @@ jobs: VALIDATE_JSCPD: false VALIDATE_GO: false VALIDATE_GO_MODULES: false - # actionlint (super-linter v8.7.0) doesn't know the "parallel" step key yet; re-enable once it does + # re-enable once actionlint supports the "parallel" step key: https://github.com/rhysd/actionlint/issues/693 VALIDATE_GITHUB_ACTIONS: false VALIDATE_PHP_PHPCS: false VALIDATE_PHP_PHPSTAN: false