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

CI: Allow skipping our GHA workflows with DISABLE_GODOT_CI variable #79321

Merged

Conversation

akien-mga
Copy link
Member

@akien-mga akien-mga commented Jul 11, 2023

Useful for custom forks of Godot which don't want to run our CI for any reason.
Uses the (currently in beta) GitHub Actions configuration variables: https://docs.github.com/en/actions/learn-github-actions/contexts#vars-context

This is configured in settings/variables/actions for the repository, setting it to any value aside from an empty string will skip all jobs.

Here's how it looks like on my fork:
image

And the corresponding GitHub Actions run for this PR's branch on my fork:
https://github.com/akien-mga/godot/actions/runs/5517696597

Ideally I'd prefer a system that would outright disable the whole workflow, so no GH Actions step runs at all, instead of reporting it as successful with 5 skipped jobs. If anyone wants to look further into how to do this better, I'm open to suggestion, this is a quick proof of concept, but which should already be useful enough as is.

CC @shana

@akien-mga akien-mga added enhancement topic:buildsystem cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release labels Jul 11, 2023
@akien-mga akien-mga added this to the 4.2 milestone Jul 11, 2023
@akien-mga akien-mga requested a review from a team as a code owner July 11, 2023 08:52
@shana
Copy link
Contributor

shana commented Jul 11, 2023

Nice, this will definitely do! There's no way of not showing skipped jobs, they will always show up. The only way to not run a workflow on these events is to have a branch or path filter on the on definition itself, and I don't think you can use variables at that point, afaict (haven't tried, but wouldn't be surprised if GH evaluates those before creating the workflow context)

@myaaaaaaaaa
Copy link
Contributor

This is configured in settings/variables/actions for the repository, setting it to any value aside from an empty string will skip all jobs.

How about a regex/glob pattern instead, so that users can configure which jobs to include/exclude?

@akien-mga
Copy link
Member Author

This is configured in settings/variables/actions for the repository, setting it to any value aside from an empty string will skip all jobs.

How about a regex/glob pattern instead, so that users can configure which jobs to include/exclude?

Why not, how would the implementation look like?

Useful for custom forks of Godot which don't want to run our CI for any
reason.

This is configured in `settings/variables/actions` for the repository,
setting it to any value aside from an empty string will skip all jobs.
@akien-mga akien-mga force-pushed the ci-allow-skipping-gha-on-forks branch from 7459869 to 4646762 Compare August 2, 2023 15:48
@YuriSizov YuriSizov self-requested a review August 2, 2023 16:21
@YuriSizov YuriSizov merged commit dc05278 into godotengine:master Aug 2, 2023
14 checks passed
@YuriSizov
Copy link
Contributor

Thanks!

@YuriSizov
Copy link
Contributor

@myaaaaaaaaa If you have ideas how to make it easier to configure, please feel free to open a follow-up PR!

@YuriSizov
Copy link
Contributor

Cherry-picked for 4.1.2.

@YuriSizov YuriSizov removed the cherrypick:4.1 Considered for cherry-picking into a future 4.1.x release label Aug 2, 2023
@akien-mga akien-mga deleted the ci-allow-skipping-gha-on-forks branch August 3, 2023 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants