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

CI with GitHub Actions? #86

Closed
ZanSara opened this issue Apr 13, 2023 · 4 comments · Fixed by #87
Closed

CI with GitHub Actions? #86

ZanSara opened this issue Apr 13, 2023 · 4 comments · Fixed by #87
Milestone

Comments

@ZanSara
Copy link

ZanSara commented Apr 13, 2023

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
Copy link
Collaborator

Mandera commented Apr 16, 2023

This'd be great - workflow is generated here

Somewhat related to

@ZanSara
Copy link
Author

ZanSara commented Apr 17, 2023

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

@Mandera Mandera transferred this issue from ManderaGeneral/generalimport Apr 24, 2023
@Mandera Mandera moved this to 🟡 In Progress in All Issues Apr 29, 2023
@Mandera Mandera pinned this issue Apr 29, 2023
@Mandera
Copy link
Collaborator

Mandera commented Apr 29, 2023

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:https://[email protected]/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

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 we could create a nice little table for which branch was used for each repo

@Mandera Mandera added this to the Contributing milestone Apr 30, 2023
@Mandera
Copy link
Collaborator

Mandera commented Apr 30, 2023

Current simple plan

  • Make EnvVars raise skiptest exception
  • Create a new workflow file for pushing to all branches but master
  • Run matrix tests
Idea for clean git history

Once this is incorporated we could

  • Protect master
  • Create pull requests
  • Tests pass
  • Squash commits, maintain author somehow
  • 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?)

Mandera added a commit to ManderaGeneral/generallibrary that referenced this issue May 2, 2023
Mandera added a commit to ManderaGeneral/generallibrary that referenced this issue May 4, 2023
Applied for skipping `gh` calls if `GH_TOKEN` is missing

ManderaGeneral/generalpackager#86
Mandera added a commit to ManderaGeneral/generallibrary that referenced this issue May 4, 2023
Applied for skipping `gh` calls if `GH_TOKEN` is missing

ManderaGeneral/generalpackager#86
@Mandera Mandera linked a pull request May 4, 2023 that will close this issue
@github-project-automation github-project-automation bot moved this from 🟡 In Progress to 🟢 Done in All Issues May 4, 2023
Mandera added a commit that referenced this issue May 4, 2023
I thought -a added new files too, but a `git add .` is required
Mandera added a commit to ZanSara/generalimport that referenced this issue May 9, 2023
@Mandera Mandera unpinned this issue Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🟢 Done
Development

Successfully merging a pull request may close this issue.

2 participants