Skip to content

Commit c46bd47

Browse files
committed
don't fail examples that are expected to fail
1 parent e9f3de5 commit c46bd47

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

.github/workflows/check-releasability.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,11 @@ jobs:
340340
with:
341341
repository: bevyengine/bevy
342342
ref: main
343+
- name: Keep initial state
344+
id: initial
345+
run: |
346+
initial=`toml get Cargo.toml example | jq -c '.[] | select(.name=="${{ matrix.example }}") | ."doc-scrape-examples"'`
347+
echo "initial=$initial" >> $GITHUB_OUTPUT
343348
- name: Checkout Releasability
344349
uses: actions/checkout@v4
345350
with:
@@ -356,8 +361,23 @@ jobs:
356361
sudo apt-get update;
357362
DEBIAN_FRONTEND=noninteractive sudo apt-get install --no-install-recommends -yq libasound2-dev libudev-dev libxkbcommon-x11-0 libwayland-dev libx264-164 libx264-dev
358363
- name: Document with scrapping example
364+
id: scrape
365+
continue-on-error: true
359366
run: |
360367
cargo +nightly doc -Zunstable-options -Zrustdoc-scrape-examples --no-deps
368+
- name: Fail when needed
369+
run: |
370+
if [[ ${{ steps.initial.outputs.initial }} == "false" ]]; then
371+
if [[ ${{ steps.scrape.outcome }} == "success" ]]; then
372+
echo "Failure expected but succeeded"
373+
exit 1
374+
fi
375+
else
376+
if [[ ${{ steps.scrape.outcome }} == "failure" ]]; then
377+
echo "Success expected but failed"
378+
exit 1
379+
fi
380+
fi
361381
362382
release-private-registry:
363383
name: Release to Private Registry

0 commit comments

Comments
 (0)