diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ba4fa1dbbcd4..703f51207c8e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,8 @@ on: jobs: test: + permissions: + checks: write strategy: # Default is true, cancels jobs for other platforms in the matrix if one fails fail-fast: false @@ -127,20 +129,29 @@ jobs: # echo "status=$?" >> $GITHUB_OUTPUT - name: Install Hurl - if: matrix.os == 'linux' + if: matrix.os == 'linux' && matrix.go == '1.21' run: | curl --location --remote-name https://github.com/Orange-OpenSource/hurl/releases/download/4.2.0/hurl_4.2.0_amd64.deb sudo dpkg -i hurl_4.2.0_amd64.deb + - name: Run Caddy - if: matrix.os == 'linux' + if: matrix.os == 'linux' && matrix.go == '1.21' working-directory: ./cmd/caddy run: | ./caddy start - name: Run tests with Hurl - if: matrix.os == 'linux' + if: matrix.os == 'linux' && matrix.go == '1.21' run: | - find . -name *.hurl -exec hurl --test --color {} \; + mkdir hurl-report + find . -name *.hurl -exec hurl --test --report-junit hurl-report/junit.xml --color {} \; + + - name: Publish Test Results + if: matrix.os == 'linux' && matrix.go == '1.21' + uses: EnricoMi/publish-unit-test-result-action@v2 + with: + files: | + hurl-report/junit.xml # Relevant step if we reinvestigate publishing test/coverage reports # - name: Prepare coverage reports diff --git a/caddytest/spec/http/headers/spec.hurl b/caddytest/spec/http/headers/spec.hurl new file mode 100644 index 000000000000..30b221a32856 --- /dev/null +++ b/caddytest/spec/http/headers/spec.hurl @@ -0,0 +1,22 @@ +# Configure Caddy +POST http://localhost:2019/load +User-Agent: hurl/ci +Content-Type: text/caddyfile +``` +{ + skip_install_trust + http_port 9080 + https_port 9443 + local_certs +} +localhost { + header -Server +} +``` + +GET https://localhost:9443 +[Options] +insecure: true +HTTP 200 +[Asserts] +header "Server" == ""