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

Implement ci target for Makefile to reproduce github CI actions & artifacts #1769

Merged
merged 11 commits into from
Aug 4, 2023

Conversation

ia
Copy link
Collaborator

@ia ia commented Aug 1, 2023

  • Please check if the PR fulfills these requirements
  • The changes have been tested locally
  • There are no breaking changes
  • What kind of change does this PR introduce?
    Implement ci target for Makefile to reproduce github CI actions & artifacts.

  • What is the current behavior?
    There is no fast & easy way to reproduce github CI jobs locally, for testing & debugging purposes or for preparing local zips with builds in bulk.

  • What is the new behavior (if this is a feature change)?
    By running one make ci command, the produced binaries will be collected and packed into zips inside local BUILDS/CI directory with the same content as downloadable zips from Actions tab on github has.

  • Other information:
    Unfortunately, that's not "reproducible builds" per se, but nevertheless it's useful to have the same pipeline locally to exclude the factor of build environment in the case of some problem.

P.S. After a bit of puzzling myself how to take into consideration all the variations with names & lang options related to metadata json generating/parsing inside of Makefile, I just took some liberty to tweak a bit metadata.py instead. ;)

source/metadata.py Outdated Show resolved Hide resolved
source/metadata.py Outdated Show resolved Hide resolved
source/metadata.py Outdated Show resolved Hide resolved
source/metadata.py Outdated Show resolved Hide resolved
Copy link
Owner

@Ralim Ralim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤞🏼 the comments make sense

@ia
Copy link
Collaborator Author

ia commented Aug 2, 2023

🤞🏼 the comments make sense

Sure! Since this change in metadata.py is for very specific use case, I tried to be as less "invasive" to existing code base as possible, hence some shortcuts have been implied.

At first I wondered why the script scans all the files in the directory instead of reduce scanning to a pattern since the script have knowledge about model including multilang status (the first argument for json output file name) but:

  • I'm not sure I could do better myself;
  • my policy [for any project] is: if you don't know for 100% sure why some design decisions have been made long before you - don't touch it (or keep it fully compatible even after refactoring) because if you do you probably will break something somewhere.

@ia
Copy link
Collaborator Author

ia commented Aug 2, 2023

Oh, wait... since we change this script & a bit of its logic anyway, I think I have just one more little idea for tiny improvement here...

…before looping through them to get the same lang order on every generation in every json output file
@ia
Copy link
Collaborator Author

ia commented Aug 2, 2023

Done & tested: I made a full local build using make ci and then I did compare content of metadata.zip with the one from github: everything seems fine. The only one thing which doesn't match between local & github json files is a commit tag but that's another matter which I was going to work on anyway soon.

@ia ia requested a review from Ralim August 2, 2023 15:43
@Ralim Ralim merged commit 3f880d9 into Ralim:dev Aug 4, 2023
@ia ia deleted the make-ci branch August 5, 2023 20:31
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