From beee23dc96c3eae99fd9108c7f09ff40db10189c Mon Sep 17 00:00:00 2001 From: Sergey Marin Date: Fri, 16 Oct 2026 23:20:49 +0300 Subject: [PATCH] ci: run the examples the documented way and publish a JUnit report (bddkit/bddkit-browser#4) --- .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4dac57..14ed306 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,6 +31,10 @@ jobs: e2e-chrome: name: e2e against a Chrome container runs-on: ubuntu-latest + # `checks: write` is for the example report below, published as a Check Run. + permissions: + contents: read + checks: write steps: - uses: actions/checkout@v6 - uses: actions-rust-lang/setup-rust-toolchain@v1 @@ -46,6 +50,26 @@ jobs: run: docker compose up -d --wait - name: End-to-end run: cargo test --locked --test e2e -- --test-threads=1 --nocapture + # The documented path, verbatim from examples/README.md: the lock in + # examples/.bddkit points at target/release, the site is the example + # binary on :3000, the config is examples/browser.yaml itself. + - name: Examples, the documented way + run: | + cargo build --locked --release + cargo run --locked --quiet --example site & + site=$! + trap 'kill $site' EXIT + timeout 60 sh -c 'until curl -sf http://localhost:3000 >/dev/null; do sleep 1; done' + bddkit run --config examples/browser.yaml --junit "$RUNNER_TEMP/reports/browser.xml" + # `always()`: a red run is exactly when the report is wanted. A PR from + # a fork gets a read-only token and cannot create the Check Run. + - name: Example report + if: always() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) + uses: dorny/test-reporter@v2 + with: + name: Examples (Chrome) + path: ${{ runner.temp }}/reports/*.xml + reporter: java-junit e2e-firefox-managed: name: e2e on a managed Firefox