Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Make existing build workflows reusable #499

Merged
merged 32 commits into from
Jul 15, 2023

Conversation

traunts
Copy link
Collaborator

@traunts traunts commented Jun 11, 2023

Refactor the two build workflows, msbuild and meson to be reusable per #470, and use these changes to simplify the CI script vastly.
Reduces code duplication so we don't have to maintain more than one copy of a build script at any given time.

Resolves an issue where we built a debug build instead of a release build when performing compilation checks.

Required work for #460 (or at least, simplifies anything that needs to build the game rather than duplicating code).

traunts added 5 commits June 11, 2023 16:59
Disable msbuild workflow triggers on push to master/dev branches and add parameters for workflow call inputs

Remove `push` workflow triggers, as they are no longer required and will be triggered by calling workflow.
Add inout parameters to define which build configuration to use an whether this run should upload its build artefacts.
Rework the meson build workflow to act as a callable workflow in a composite job.

Disable triggering on pushes to dev/master.
Add input parameters to call this workflow with, that dictate:
- whether to upload build artefacts from this workflow
- which meson build type to use (release/debug)
- which debug level, if any, to compile the code at.

Switched `meson 0.6.0 => 0.6.3` to match the version in our CI script.
Split Meson setup/configuration to accommodate upload/non-upload invocations of the workflow
Configured the upload step to fail with errors if no artefacts are found to be uploaded (when the relevant setting is configured).
Remove all duplicated code and replace it with calls to the new msbuild and meson build workflows.

Update the concurrency group so that we don't waste time re-running the CI on outdated code.
Rename top-level workflow.
@traunts traunts added the refactor Code needs to be refactored label Jun 11, 2023
@traunts traunts added this to the PreRelease v6.0 milestone Jun 11, 2023
@traunts traunts requested review from garethyr, HeliumAnt, MaximDude and a team June 11, 2023 07:51
@traunts traunts linked an issue Jun 11, 2023 that may be closed by this pull request
@traunts
Copy link
Collaborator Author

traunts commented Jun 11, 2023

This is technically a duplicate & extension of work done in #461, however that one never made it to the main branches and likely won't as it'll be discarded and re-written.

@traunts traunts changed the title 470 Make existing build workflows reusable Make existing build workflows reusable Jun 11, 2023
traunts added 5 commits July 5, 2023 08:57
Adds a new `master_build` workflow, identical to the existing CI workflow except:
- It only runs on new pushes to `master`
- It uploads all build artefacts to make them available for release

Minor comment formatting.
Copy link

@garethyr garethyr left a comment

Choose a reason for hiding this comment

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

This looks super clean, nice job!

I've got a couple questions and some very minor comments

@traunts
Copy link
Collaborator Author

traunts commented Jul 7, 2023

Another irk that I had with these changes is GitHub's damn response to the concurrency changes.

It sees a workflow run that's cancelled (due to newer changes invalidating the output of the run) as a job failure (marking that commit as failing checks) and sends a pesky email every time.

Not sure if there's a way to filter these so that cancellations are discarded, and it's more a personal peeve than anything else, but I thought it best to make known.

@traunts traunts requested a review from garethyr July 7, 2023 04:27
@garethyr
Copy link

garethyr commented Jul 7, 2023

Another irk that I had with these changes is GitHub's damn response to the concurrency changes.

It sees a workflow run that's cancelled (due to newer changes invalidating the output of the run) as a job failure (marking that commit as failing checks) and sends a pesky email every time.

Not sure if there's a way to filter these so that cancellations are discarded, and it's more a personal peeve than anything else, but I thought it best to make known.

I'd certainly be happy to not have email spams haha. But if I have to have it, so be it I guess.

@traunts
Copy link
Collaborator Author

traunts commented Jul 7, 2023

Another irk that I had with these changes is GitHub's damn response to the concurrency changes.
It sees a workflow run that's cancelled (due to newer changes invalidating the output of the run) as a job failure (marking that commit as failing checks) and sends a pesky email every time.
Not sure if there's a way to filter these so that cancellations are discarded, and it's more a personal peeve than anything else, but I thought it best to make known.

I'd certainly be happy to not have email spams haha. But if I have to have it, so be it I guess.

The issue only occurs when repeatedly pushing to the same PR in a short span of time. It saves wasted workflow runs, but each run that it cancels incurs the notification. For large sets of batched changes it's non-existent, just an issue for constant small ones that are pushed before CI finishes.

traunts added 3 commits July 7, 2023 22:17
…le when uploading artefacts

Add an extended glob pattern to match either of them if present (trailing `_debug`)
@traunts traunts requested a review from HeliumAnt July 15, 2023 08:54
Copy link

@HeliumAnt HeliumAnt left a comment

Choose a reason for hiding this comment

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

Looking good 👍

@garethyr garethyr enabled auto-merge July 15, 2023 17:35
@garethyr garethyr disabled auto-merge July 15, 2023 18:40
@garethyr garethyr merged commit b72fdb3 into development Jul 15, 2023
@garethyr garethyr deleted the 470-make-existing-build-workflows-reusable branch July 15, 2023 18:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
refactor Code needs to be refactored
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make existing build workflows reusable
3 participants