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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix potential github action smells #3449

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ceddy4395
Copy link

Fixes

Hey! 馃檪
I want to contribute the following changes to your workflow:

  • Avoid running CI related actions when no source code has changed
  • Avoid executing scheduled workflows on forks
  • Avoid jobs without timeouts

(These changes are part of a research Study at TU Delft looking at GitHub Action Smells. Find out more)

Proposed Changes/Todos

Pull Request checklist:

  • I've named my PR in the form of "Fixes #issue. Terse description."
  • My code follows the style guidelines of Terminal.Gui - if you use Visual Studio, hit CTRL-K-D to automatically reformat your files before committing.
  • My code follows the Terminal.Gui library design guidelines
  • I ran dotnet test before commit
  • I have made corresponding changes to the API documentation (using /// style comments)
  • My changes generate no new warnings
  • I have checked my code and corrected any poor grammar or misspellings
  • I conducted basic QA to assure all features are working

- Avoid running CI related actions when no source code has changed
- Avoid executing  scheduled workflows on forks
- Avoid jobs without timeouts
@ceddy4395 ceddy4395 requested a review from tig as a code owner May 5, 2024 19:20
Copy link
Collaborator

@dodexahedron dodexahedron left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks!

Plenty more we could do, too, but these hit some really big sources of noise. 馃憤

@dodexahedron
Copy link
Collaborator

dodexahedron commented May 7, 2024

Also, a thought for future consideration for us before it disappears from my head again:

Especially with regards to Roslyn analyzers/generators, we may want to consider caching, so that they don't have to get built every time, unless one of the analyzer projects is actually modified. Would speed up the build actions. Efficiency of those actions does matter, because there is a limit to how much execution time is allowed per month.

Copy link
Collaborator

@dodexahedron dodexahedron left a comment

Choose a reason for hiding this comment

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

Still fine to me, regardless of comments I just added.

Those are notes for me while I'm completely re-working things and aren't related to the changes made.

@@ -4,6 +4,8 @@ on:
push:
# only publish v2 (main or develop); v2 is published via the Terminal.GuiV2Docs repo
Copy link
Collaborator

Choose a reason for hiding this comment

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

The comment here is not quite accurate with what this actually does.

@@ -29,6 +29,7 @@ jobs:
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could clean this up, too, if we use an actual matrix.

And the default comments from the template are not relevant for us, so they could go away.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually... This is codeQL scanning and we do not have OS-specific dependencies.

We could do it on just one runner for this workflow unless anyone has any thoughts otherwise.

Copy link
Author

Choose a reason for hiding this comment

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

Out of curiosity, what runner would in that case take your preference? The Ubuntu one?

Copy link
Collaborator

Choose a reason for hiding this comment

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

May as well be that one. Likely to have the lowest total running time cost.

Copy link
Author

Choose a reason for hiding this comment

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

Ah yes clear!

@@ -29,6 +29,7 @@ jobs:
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
if: github.repository == 'gui-cs/Terminal.Gui'|| github.event_name == 'schedule'
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is the best part of it all. Thanks for getting fed up and doing it! :)

It's so noisy for forks, for various other reasons.

Copy link
Author

Choose a reason for hiding this comment

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

No worries, thank you for the feedback, very appreciated! 馃槃

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

2 participants