Skip to content

ci: declare shell: bash as the workflow default so every run step gets pipefail - #911

Open
jessealama wants to merge 1 commit into
leanprover:mainfrom
jessealama:ci/default-shell-bash
Open

jessealama wants to merge 1 commit into
leanprover:mainfrom
jessealama:ci/default-shell-bash

Conversation

@jessealama

Copy link
Copy Markdown
Contributor

Adds a workflow-level defaults: run: shell: bash block to the six workflows that have run: steps. The issue is that when a step has no shell: key, GitHub runs it under bash -e {0}. That's good, but we can do better. The explicit declaration upgrades this to bash --noprofile --norc -eo pipefail {0}, so every step automatically gets the pipefail option set.

Remove set -e lines in lean_action_ci.yml are dropped, since they're redundant.

When a run step has no shell key, GitHub executes it with 'bash -e {0}';
declaring 'shell: bash' explicitly upgrades that to
'bash --noprofile --norc -eo pipefail {0}', so every step gets pipefail
for free. Applied to the six workflows that have run steps.

Audited every existing pipeline for behaviour changes:
- weekly-lints: 'lake build | tee' already sets pipefail by hand and
  captures the status with '|| build_status=$?', so nothing changes
- shellcheck: a failure of the 'find' feeding xargs now fails the step
  instead of being masked
- the remaining bash steps contain no pipelines

The explicit 'set -e' lines in lean_action_ci.yml are dropped as
redundant; steps with 'shell: python' are unaffected by the default.
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.

1 participant