Kawa-oneechan / SCICompanion

SCI Companion - an editor for Sierra SCI games, altered.
18 stars 7 forks source link

Add GitHub Actions workflow, build on push #15

Closed laurence-myers closed 1 year ago

laurence-myers commented 1 year ago

I was thinking it'd be nice to have some automated regression tests. It could let us make future changes with confidence. As a first step, I've set up a GitHub Actions workflow, which builds SCICompanion.exe.

Here's an example run:

https://github.com/laurence-myers/SCICompanion/actions/runs/4602703641

The produced artifact zip is named like SCICompanion-${{ matrix.configuration }}-${{ matrix.platform }}-${{ github.sha }}. It contains the compiled SCICompanion.exe, and any sub-directories included in the build (e.g. include, the template projects, DOSBox, etc). Artifacts only live for 90 days, so you would probably want to create a "Release" in GitHub for anything you want to keep.

Currently, it only builds the "Kawa" configuration targeting the "Win32" platform. I've defined these in a matrix, so we can easily create builds for "Release" and/or "x64", and any combination of config/platform.

It currently runs on every push to every branch.

It looks like builds take 11-15 minutes to run.

Note that the GitHub Windows runner doesn't include MSVC 2015 (platform tools v140), nor Windows 8.1 SDK, so they have to be manually downloaded and installed. If we can update the project to use a newer MSVC (Visual Studio 2022 or 2019) and target Windows 10 SDK, then we could save ~5 minutes on the build (since the runner already includes them).

Example

Workflow

2023-04-04 11_07_43-GitHub Actions_ include all non-compiled resources in the build artif… · laurenc

Job

2023-04-04 11_07_59-GitHub Actions_ include all non-compiled resources in the build artif… · laurenc

Artifact contents

2023-04-04 11_09_12-SCICompanion-Kawa-Win32-921c75721abe5f8e65d23d4c544bf458637c070f zip

Kawa-oneechan commented 1 year ago

I'll have to sleep on this one...

Kawa-oneechan commented 1 year ago

Artifacts only live for 90 days, so you would probably want to create a "Release" in GitHub for anything you want to keep.

How hard would that be?

laurence-myers commented 1 year ago

Anything is possible! 😁

It looks fairly straightforward using this action:

https://github.com/softprops/action-gh-release

It could even generate the release notes!

I can play around with it. Let me know what you'd like it to do. As an example, any push to "master" could create a release, named after the date (UTC) and short SHA.

I also found this action, which produces a "nightly" release. Maybe that's better than producing multiple releases per day if there's multiple commits.

https://github.com/marketplace/actions/deploy-nightly

Otherwise, it could upload the assets somewhere, like some web host or AWS S3.

On Tue, 4 Apr. 2023, 10:00 pm Kawa, @.***> wrote:

Artifacts only live for 90 days, so you would probably want to create a "Release" in GitHub for anything you want to keep.

How hard would that be?

— Reply to this email directly, view it on GitHub https://github.com/Kawa-oneechan/SCICompanion/pull/15#issuecomment-1495850772, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQK4MHBQJKZLK45F3J7VOLW7QEPBANCNFSM6AAAAAAWSAV3OI . You are receiving this because you authored the thread.Message ID: @.***>

Kawa-oneechan commented 1 year ago

Nightly would be great, especially if it simply doesn't do anything if nothing happened.

laurence-myers commented 1 year ago

I've added a separate workflow to generate a build & release each night. It took a while to work out. 😅

Nightly builds run at 7:15 AM UTC. They will create a new build, tag, and release. Artifact zips are renamed, replacing the SHA with the date. A release is not created if the current commit already has a tag beginning with nightly/. Nightly builds only run on the default branch, i.e. master.

I've changed the existing build job into a reusable workflow, and added a separate on-push.yaml file

2023-04-11 18_21_52-Actions · laurence-myers_SCICompanion — Mozilla Firefox

Example nightly build

2023-04-11 18_21_12-Nightly Build · laurence-myers_SCICompanion@b161e9a — Mozilla Firefox

Example skipped nightly build

2023-04-11 18_20_43-Nightly Build · laurence-myers_SCICompanion@b161e9a — Mozilla Firefox