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

Make posix and msys2 shells consistent in CI #4653

Closed
wants to merge 1 commit into from
Closed

Make posix and msys2 shells consistent in CI #4653

wants to merge 1 commit into from

Conversation

ppigazzini
Copy link
Contributor

@ppigazzini ppigazzini commented Jul 1, 2023

In CI, it is typical for the process to halt immediately when an error is encountered. However, with our shell: bash {0} configuration, the process continues despite errors for posix shells.
This commit updates the behavior of posix and msys2 shells to ensure consistency in terms of pipeline exit codes and stop conditions. We adopt the most appropriate default behavior as recommended by the GitHub documentation.

Update the code that searches for the bench value in the git log:

  • to be compatible with the new shell settings
  • to retry the value from the first line that contains only the template and spaces/tabs/newlines
$ false | true
$ echo $?
1

Shell parameters in Github Actions:

- posix:
  - shell undefined  -> bash -e {0}
  - shell: bash      -> bash --noprofile --norc -eo pipefail {0}
- msys2:
  - shell: msys2 {0} -> bash -leo pipefail {0}

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference https://github.com/msys2/setup-msys2/blob/main/main.js

closes #4653

No functional change

@ppigazzini ppigazzini marked this pull request as draft July 1, 2023 18:30
In CI, it is typical for the process to halt immediately when an error
is encountered. However, with our `shell: bash {0}` configuration,
the process continues despite errors for posix shells.
This commit updates the behavior of posix and msys2 shells to ensure
consistency in terms of pipeline exit codes and stop conditions.
We adopt the most appropriate default behavior as recommended
by the GitHub documentation.

Update the code that searches for the bench value in the git log:
- to be compatible with the new shell settings
- to retry the value from the first line that contains
  only the template and spaces/tabs/newlines

```
$ false | true
$ echo $?
1
```
Shell parameters in Github Actions:
```
- posix:
  - shell undefined  -> bash -e {0}
  - shell: bash      -> bash --noprofile --norc -eo pipefail {0}
- msys2:
  - shell: msys2 {0} -> bash -leo pipefail {0}
```

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference
https://github.com/msys2/setup-msys2/blob/main/main.js

closes #4653

No functional change
@ppigazzini ppigazzini marked this pull request as ready for review July 1, 2023 18:57
@vondele vondele closed this in 9a2d50e Jul 2, 2023
@ppigazzini ppigazzini deleted the ci_set_bash branch July 2, 2023 09:08
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

1 participant