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

GitHub action #51

Merged
merged 5 commits into from
May 6, 2021
Merged

GitHub action #51

merged 5 commits into from
May 6, 2021

Conversation

f-koehler
Copy link
Contributor

Dear @naggie,

please consider this PR for a Github action that automatically compiles the code (as discussed in #50). Currently it builds for the following architectures:

  • x86_64
  • arm:
    • v5
    • v6
    • v7
  • arm64 (armv8)

Adding more is straightforward.
Two different go versions are used:

  • 1.15
  • 1.16

I discovered this nice website which tells you which go versions are supported. It is necessary to manually update the action from time to time.

As a next step it would be nice to add an action to automate releases. I do this for some python projects and it really saves a lot of time. But I think this action is a good start and enough for now.

With my best regards,
@f-koehler

@naggie
Copy link
Owner

naggie commented May 5, 2021

Thanks @f-koehler -- seems like a good start and won't affect the current release process. What happens to the built artefacts? I assume they're not stored anywhere. Does that mean this will work like a rudimentary CI system, checking each commit builds?

I'll add some unit tests some day....

@f-koehler
Copy link
Contributor Author

I just grabbed the default setup-go action and modified it to use multiple go versions as well as architectures. It runs on every push to the master branch as well as on every PR against the master branch. This does not do anything with the build artifacts, they will be deleted afterwards. So it does not interfere with anything (it is just an additional thing that ensures that the code runs fine).

When unit tests (as long as go test detects them) are added they will also be run and the action will complain if one of them fails. I thought about how to do unit tests and think for such a project and think it is not as straightforward as for other types of codes. I will add my thoughts to #23 when I find the time.

One could take it further from here however and create releases automatically and/or upload to the build artifacts to them. I think something like goreleaser would be very helpful here. They also provide a GitHub action (docs are here).

One could decide how far one wants to take it. In my python projects I now trigger it by adding a special file to the repo that gets deleted by the action. This creates a tag, bumps version numbers and uploads python pacakges to PyPI. But one could also trigger it by creating and pushing a tag. Many thinks are conceivable here.

I think want I created so far is basic enough that it can be merged without causing any problems.

@naggie
Copy link
Owner

naggie commented May 6, 2021

Excellent, thanks. That's the second time I've heard goreleaser mentioned so I'll take a look!

@naggie naggie merged commit 033c19f into naggie:master May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants