Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail workflow on documentation build failures #502

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

jakelishman
Copy link
Contributor

Summary

The documentation-build script did not propagate failures from individual lines, which meant that a failure in the script could still result in an attempted empty deployment, which deletes the whole website. This ensures that the bash script propagates the failure through to the workflow status, so the deployment does not trigger.

We also fix the failure that took out the website last time - a missing transitive dependency (which isn't our fault, but is easy to work around).

Details and comments

Since I was at it, and apparently I hooked shellcheck in to vim at some point, I quoted the argument expansions it was moaning about.

I ran a dummy run of this commit with the deployment replaced with an artefact upload on my fork, which you can see ran successfully here: https://github.com/jakelishman/openqasm/actions/runs/7211750781.

The documentation-build script did not propagate failures from
individual lines, which meant that a failure in the script could still
result in an attempted empty deployment, which deletes the whole website.
This ensures that the bash script propagates the failure through to the
workflow status, so the deployment does not trigger.

We also fix the failure that took out the website last time - a missing
transitive dependency (which isn't our fault, but is easy to work
around).

# Build the stable version list
unset versionList
for branch in `git for-each-ref --format='%(refname:short)' --sort=-refname refs/${repoPath}/stable/`; do
versionList=""
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with set -u, unset versionList would have caused a failure in the [ -z "$versionList" ] expansion. I suppose I could have used [ -z ${versionList:-} ], but I didn't think of it at first - happy to change it if that's more legible.

@jakelishman
Copy link
Contributor Author

The AST CI failures in this one are fixed by #503.

Copy link
Contributor

@jlapeyre jlapeyre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@jlapeyre jlapeyre merged commit deb47a9 into openqasm:main Dec 15, 2023
7 of 9 checks passed
@jakelishman jakelishman deleted the fix-docs-deploy branch December 15, 2023 09:03
@blakejohnson
Copy link
Contributor

Thanks, @jakelishman

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants