cross-platform-actions / action

Cross-platform GitHub action
MIT License
128 stars 19 forks source link

Ability to print timings of the various steps performed #57

Closed yorickpeterse closed 1 year ago

yorickpeterse commented 1 year ago

I'm using this action to run tests of https://github.com/inko-lang/inko on FreeBSD. What I'm seeing is build times in the order of 15-20 minutes, even though the tests only run for about 5-10 minutes. Looking at the output it's not really clear where time is being spent, though I have a suspicion the syncing of files is taking up most of the time.

Is there a way to have the action print timings of the individual steps performed? That might help narrow down where the time is being spent. :smiley:

jacob-carlborg commented 1 year ago

There are a couple of things you can try out of the box:

yorickpeterse commented 1 year ago

@jacob-carlborg

You can show timestamps of the workflow log by clicking the gear icon in the top right corner when viewing a job:

Oh my, I had completely forgotten about that. :facepalm:

From these timings, I found the following:

Out of these, I think pre-installing Git is the only change that could be worth making, as I'm not sure the rsync commands could be made any faster, short of running it in parallel somehow.

jacob-carlborg commented 1 year ago

Out of these, I think pre-installing Git is the only change that could be worth making

I'm a bit reluctant to add new pre installed packages. I want to keep the VM images as small as possible to reduce download time and boot overhead. There's always going to be someone that wants to add some other package that is not installed by default. Although, in this particular case, Git would be reasonable to have installed by default. I'll take a look at how much the size increases when Git is added.

Another alternative is allow custom VM images. Then anyone can add their particular default packages and the size increase won't affect anyone else.

as I'm not sure the rsync commands could be made any faster, short of running it in parallel somehow.

I'll look into that.

yorickpeterse commented 1 year ago

For the time being I ended up forking this action and the freebsd-builder project, pulling in https://github.com/cross-platform-actions/action/pull/13 so I can use a custom image. Getting it up and running took a bid of fiddling around, but it seems to work well so far, and shaves off a good 10 minutes from my build times :smile:

For those wanting to do the same, take a look at this and this, and this commit that applies it to my project in question.

jacob-carlborg commented 1 year ago

For the time being I ended up forking this action and the freebsd-builder project, pulling in https://github.com/cross-platform-actions/action/pull/13 so I can use a custom image.

Seems I need to finish this feature now 😄.

jacob-carlborg commented 1 year ago

I've added official support for custom VM images now: https://github.com/cross-platform-actions/action/releases/tag/v0.18.0. Can we close this issue?

yorickpeterse commented 1 year ago

@jacob-carlborg Yes, it's working perfectly. Thanks! :tada: