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

[skip ci] build only required modules #6900

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

AwkwardPeak7
Copy link
Contributor

  • prepare
    • gets file diff from successful ci run to present
    • for src changes, adds the corrosponding module
    • for lib or multisrc changes, gets it's corrospoinding modules
  • build step is similar as before with matrix chunks
  • repo commit
    • removes old changed or deleted apks/icons from current repo
    • merges new ones
    • merges the index.min.json

needs (more) testing and review

  • pr workflow is untested yet
  • ci workflow should be fine up until repo deploy step, which needs testing
    • tested in act

to_delete = json.loads(sys.argv[1])

for module in to_delete:
apk_name = f"tachiyomi-{module}-v1.4.*.apk"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
apk_name = f"tachiyomi-{module}-v1.4.*.apk"
apk_name = f"tachiyomi-{module}-v*.*.*.apk"

import json
import sys
from pathlib import Path
from typing import List, Tuple, Dict, Any
Copy link
Contributor

Choose a reason for hiding this comment

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

List, Tuple, and Dict can be replaced with list, tuple, and dict since Python 3.9, which is oldest version that is still supported.


return list(modules), list(deleted)

def chunker(iterable: List[str], size: int) -> Dict[str, Any]:
Copy link
Contributor

Choose a reason for hiding this comment

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

Should replicate the signature of itertools.batched, the docs contain an implementation that can be used for Python <3.12.

Copy link
Contributor

Choose a reason for hiding this comment

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

Further down you would use something like (can probably be formatted better):

chunked = {"chunk": [{"num": i, "modules": list(batch)} for i, batch in enumerate(batched(modules, int(os.getenv("CI_CHUNK_SIZE", 65))))]}

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