ameliatastic / seahorse-lang

Write Anchor-compatible Solana programs in Python
Apache License 2.0
313 stars 43 forks source link

Add CI workflow: compile example files + check for any changes #63

Closed mcintyre94 closed 1 year ago

mcintyre94 commented 1 year ago

This PR is intended to improve our robustness, by requiring that any changes to the compiled output of the example Seahorse files is know about and reviewed. This should mostly avoid me introducing more bugs :p

I've tested it on my own fork:

It hasn't run on this PR, I assume that's a github security limitation for new workflows.

Note that currently the examples are quite limited, there are many areas they don't cover. Improving this in future PRs would be a valuable contribution, and double as extra documentation! But in particular because they're all single files being compiled with seahorse compile, the Python imports feature can't currently be tested with it. We might want to add some examples using seahorse build in a full-fledged seahorse project going forward. But I think this is a good start and that most things will be better served by simple single file tests.

ameliatastic commented 1 year ago

It's so beautiful ;-;

I'm not super familiar with Github workflows though, do I need to do anything besides just merge this PR? And if so, what does the workflow look like - will it prevent merging changes that don't pass the test?

mcintyre94 commented 1 year ago

It's so beautiful ;-;

I'm not super familiar with Github workflows though, do I need to do anything besides just merge this PR? And if so, what does the workflow look like - will it prevent merging changes that don't pass the test?

Not what my bash scripts are usually called! 😆

I'm not super familiar either, but when I opened a PR on my fork it ran the workflow right away - so I think it just needs to be merged. There's a repo setting Actions > General > Actions Permissions, which looks like it can enable/disable workflows. I have it set to "Allow any actions and reusable workflows" which I think is the default.

By default it will show the workflow result but not block merging. You can require status checks under Settings > Branches if the PR is to a protected branch, but I think that's all disabled by default.

ameliatastic commented 1 year ago

Awesome! Interested to see what happens next time I try to fix a bug then.