Skip to content

GH Actions: use explicit bash shell & other defaults#6654

Merged
oliver-sanders merged 1 commit intocylc:8.4.xfrom
MetRonnie:actions
Mar 18, 2025
Merged

GH Actions: use explicit bash shell & other defaults#6654
oliver-sanders merged 1 commit intocylc:8.4.xfrom
MetRonnie:actions

Conversation

@MetRonnie
Copy link
Copy Markdown
Member

@MetRonnie MetRonnie commented Mar 5, 2025

https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#defaultsrunshell

Supported platform shell parameter Description Command run internally
Linux / macOS unspecified The default shell on non-Windows platforms. Note that this runs a different command to when bash is specified explicitly. If bash is not found in the path, this is treated as sh. bash -e {0}
All bash The default shell on non-Windows platforms with a fallback to sh. When specifying a bash shell on Windows, the bash shell included with Git for Windows is used. bash --noprofile --norc -eo pipefail {0}

This was added to the docs in actions/runner#1955; I was unaware that there was a difference between not specifying the default and specifying bash.

We seem to be missing -o pipefail by default. (This change will also introduce --norc, --noprofile; not sure why these are included 🤷)

Tip

If/when we change to using setup-micromamba/miniconda, we will need to provide the full set of options we want, which will have to include -l.

Check List

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • No dependency changes
  • tests, docs, etc not needed
  • If this is a bug fix, PR should be raised against the relevant ?.?.x branch.

@MetRonnie MetRonnie added small infrastructure GH Actions, Codecov etc. labels Mar 5, 2025
@MetRonnie MetRonnie self-assigned this Mar 5, 2025
@MetRonnie MetRonnie requested a review from oliver-sanders March 5, 2025 12:16
@oliver-sanders

This comment was marked as outdated.

@MetRonnie MetRonnie marked this pull request as draft March 11, 2025 11:28
@oliver-sanders

This comment was marked as outdated.

Copy link
Copy Markdown
Member

@oliver-sanders oliver-sanders left a comment

Choose a reason for hiding this comment

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

LGTM

@MetRonnie MetRonnie force-pushed the actions branch 2 times, most recently from d51f457 to af6614f Compare March 17, 2025 13:21
@MetRonnie MetRonnie marked this pull request as ready for review March 17, 2025 13:21
@MetRonnie

This comment was marked as resolved.

@MetRonnie
Copy link
Copy Markdown
Member Author

MacOS unit test failing 3 times in a row with

shell-init: error retrieving current directory: getcwd: cannot access parent directories: Undefined error: 0

but is unrelated

@oliver-sanders oliver-sanders merged commit 6e18e49 into cylc:8.4.x Mar 18, 2025
56 of 59 checks passed
@MetRonnie MetRonnie deleted the actions branch March 18, 2025 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure GH Actions, Codecov etc. small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants