TheAlgorithms / Lua

Algorithms and Data Structures implemented in the Lua programming language
MIT License
290 stars 56 forks source link

chore: improve Code Checks workflow #5

Closed Panquesito7 closed 1 year ago

Panquesito7 commented 1 year ago

Things added/changed:

appgurueu commented 1 year ago

Why run checks only on main? If I were to push feature branches (or upgrading CI as this branch does), I'd want to run checks on them too.

Panquesito7 commented 1 year ago

Why run checks only on main? If I were to push feature branches (or upgrading CI as this branch does), I'd want to run checks on them too.

Good point, I really didn't think of that. What could be a solution to not run multiple checks when a branch is created on the same repository (for example, only pull_request checks for this PR, we do not need push checks when we have pull_request already)?

appgurueu commented 1 year ago

Good point, I really didn't think of that. What could be a solution to not run multiple checks when a branch is created on the same repository (for example, only pull_request checks for this PR, we do not need push checks when we have pull_request already)?

I usually test locally, then push directly. I wouldn't want to create a PR for every commit I push, that would be just unnecessary overhead.

Panquesito7 commented 1 year ago

Good point, I really didn't think of that. What could be a solution to not run multiple checks when a branch is created on the same repository (for example, only pull_request checks for this PR, we do not need push checks when we have pull_request already)?

I usually test locally, then push directly. I wouldn't want to create a PR for every commit I push, that would be just unnecessary overhead.

I think you misunderstood what I tried to explain. 😅 Say: if you create a branch in the original repository and create a PR for it (like in this PR), both the push and pull_request checks will run. I think it'd be best to avoid running multiple checks when we can use only one (that's why I thought of running push checks on main only, which may not be the best solution at all times as you've specified).

I hope it'd understandable. 🙂

appgurueu commented 1 year ago

What it boils down to is: When/why would you want checks not to run on a different branch than main? I've not ran into this use case yet, so I don't see why we should support it. I'd prefer restricting this PR to just upgrading the actions.

Panquesito7 commented 1 year ago

Hmm, well, not sure I fully understand, but I think we can close this PR for now. If we want to add this or work on it again, we can always re-open it. Thanks. 🙂