diff --git a/.github/actions/setup-caddy/action.yml b/.github/actions/setup-caddy/action.yml index ba89cae4ecc54..d2cbcf418ce50 100644 --- a/.github/actions/setup-caddy/action.yml +++ b/.github/actions/setup-caddy/action.yml @@ -1,8 +1,14 @@ name: Setup Caddy server +inputs: + arch: + default: 'LINUX_X64' + required: true + description: "Set LINUX_X64 or WINDOWS (which are job names of the push.yml workflows)" runs: using: composite steps: - shell: bash + if: inputs.arch == 'LINUX_X64' env: GH_TOKEN: ${{ github.token }} run: | @@ -11,3 +17,13 @@ runs: sudo chmod +x /usr/bin/caddy sudo caddy start --config ext/curl/tests/Caddyfile continue-on-error: true + - shell: pwsh + if: inputs.arch == 'WINDOWS' + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release -R caddyserver/caddy download --pattern 'caddy_*_windows_amd64.zip' --output caddy.zip + Expand-Archive -Path caddy.zip -DestinationPath ./build/caddy -Force + ./build/caddy/caddy.exe trust + ./build/caddy/caddy.exe start --config ext/curl/tests/Caddyfile + continue-on-error: true diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 2f82179b90ec6..3d670e24597b0 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -98,6 +98,8 @@ jobs: uses: ./.github/actions/setup-mssql - name: Setup Caddy server uses: ./.github/actions/setup-caddy + with: + arch: LINUX_X64 - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: @@ -254,6 +256,10 @@ jobs: run: git config --global core.autocrlf false && git config --global core.eol lf - name: git checkout uses: actions/checkout@v4 + - name: Setup Caddy server + uses: ./.github/actions/setup-caddy + with: + arch: WINDOWS - name: Setup uses: ./.github/actions/setup-windows - name: Build diff --git a/ext/curl/tests/Caddyfile b/ext/curl/tests/Caddyfile index 67b82434ba4c6..ceba97ee93971 100644 --- a/ext/curl/tests/Caddyfile +++ b/ext/curl/tests/Caddyfile @@ -13,8 +13,8 @@ respond /serverpush/pushed "pushed response" push /serverpush /serverpush/pushed route /show_upload_size { - templates - respond `Content-length: ={{.Req.Header.Get "Content-length"}}=` + templates + respond `Content-length: ={{.Req.Header.Get "Content-length"}}=` } basic_auth /http-basic-auth {