ManderaGeneral / generalpackager

Tools to interface GitHub, PyPI, NPM and local modules / repos. Used for generating files to keep projects dry and synced. Tailored for ManderaGeneral for now.
https://pypi.org/project/generalpackager/
Apache License 2.0
0 stars 0 forks source link

CI with GitHub Actions? #86

Closed ZanSara closed 1 year ago

ZanSara commented 1 year ago

As a contributor I would find very useful to have a small CI, for example I'd like to see the tests running on the PRs I open, as a sanity check. Having a Linux machine, I can't test on Windows and MacOS for example, so I can't tell if my changes are breaking on someone else's platform.

Would you consider adding such features to this project? I can volunteer to implement them if you are happy with the idea.

Mandera commented 1 year ago

This'd be great - workflow is generated here

Somewhat related to

ZanSara commented 1 year ago

I think the matrix is very valuable! I should add that to Canals too

Mandera commented 1 year ago

I've already done some research here

The issue I ran into there can be solved by cloning the current branch for the repo each workflow belongs to git clone -b ${{ github.ref_name }} --single-branch ssh://git@github.com/ManderaGeneral/generalpackager.git

https://stackoverflow.com/questions/58033366/how-to-get-the-current-branch-within-github-actions https://stackoverflow.com/questions/1911109/how-do-i-clone-a-specific-git-branch

Possible problem with shared branches

I foresee an issue where you are working on a feature spanning multiple repos, then tests will never pass... Could make workflow dynamically checkout `${{ github.ref_name }}` for every repo! Not sure how to avoid exit code if done through cli Could create a step for each repo and use [continue-on-error](https://stackoverflow.com/questions/69182773/how-to-exclude-an-exit-code-in-github-actions-workflow-result-status) Checking out branches has a tiny chance to create use-case where you didn't intend to share the same branch name with another repo, that's probably fine though. When we start making use of [artifacts](https://github.com/ManderaGeneral/generallibrary/issues/25) we could create a nice little table for which branch was used for each repo

Mandera commented 1 year ago

Current simple plan

Idea for clean git history

Once this is incorporated we could - Protect master - Create pull requests - Tests pass - Squash commits, maintain author [somehow](https://stackoverflow.com/questions/39700184/git-squash-commits-while-retaining-authors-info) - Rebase onto master This will give us a much nicer git history moving forward p.s: Just realized we cannot really do this, I don't want to run actions with any credentials meaning some tests won't run and we won't be able to make new commits onto the branch (possibly only allow that one?)