Update dtk-template, add build cache to CI workflow (#854)

* Update dtk-template, add build cache to CI workflow

* Add --merge argument

* Add --commit-time

* Update compilers, objdiff, wibo
This commit is contained in:
LagoLunatic
2025-08-15 15:54:43 -04:00
committed by GitHub
parent c4e0bb60fb
commit d3ea38b181
4 changed files with 33 additions and 11 deletions
+16 -1
View File
@@ -25,15 +25,30 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
# Set Git config
- name: Git config
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
# Normalize file mod times
- name: Restore timestamps
run: uv run https://raw.githubusercontent.com/MestreLion/git-tools/refs/tags/v2022.12/git-restore-mtime --merge --commit-time
# Copy the original files to the workspace
- name: Prepare
run: cp -R /orig .
run: cp -a /orig .
# Restore cached files
- name: Cache build
uses: actions/cache@v4
with:
path: |
build
.ninja_deps
.ninja_log
key: ${{ runner.os }}-${{ matrix.version }}
# Build the project
- name: Build
+3 -3
View File
@@ -158,11 +158,11 @@ if args.no_asm:
# Tool versions
config.binutils_tag = "2.42-1"
config.compilers_tag = "20250520"
config.compilers_tag = "20250812"
config.dtk_tag = "v1.6.2"
config.objdiff_tag = "v3.0.0-beta.10"
config.objdiff_tag = "v3.0.0-beta.14"
config.sjiswrap_tag = "v1.2.1"
config.wibo_tag = "0.6.16"
config.wibo_tag = "0.7.0"
# Project
config.config_path = Path("config") / config.version / "config.yml"
+11 -4
View File
@@ -91,6 +91,7 @@ TOOLS: Dict[str, Callable[[str], str]] = {
"wibo": wibo_url,
}
def download(url, response, output) -> None:
if url.endswith(".zip"):
data = io.BytesIO(response.read())
@@ -107,6 +108,7 @@ def download(url, response, output) -> None:
st = os.stat(output)
os.chmod(output, st.st_mode | stat.S_IEXEC)
def main() -> None:
parser = argparse.ArgumentParser()
parser.add_argument("tool", help="Tool name")
@@ -128,12 +130,17 @@ def main() -> None:
try:
import certifi
import ssl
except:
print("\"certifi\" module not found. Please install it using \"python -m pip install certifi\".")
except ImportError:
print(
'"certifi" module not found. Please install it using "python -m pip install certifi".'
)
return
with urllib.request.urlopen(req, context=ssl.create_default_context(cafile=certifi.where())) as response:
with urllib.request.urlopen(
req, context=ssl.create_default_context(cafile=certifi.where())
) as response:
download(url, response, output)
if __name__ == "__main__":
main()
+3 -3
View File
@@ -767,11 +767,11 @@ def generate_build_ninja(
n.newline()
def write_custom_step(step: str, prev_step: Optional[str] = None) -> None:
implicit: List[str | Path] = []
implicit: List[Union[str, Path]] = []
if config.custom_build_steps and step in config.custom_build_steps:
n.comment(f"Custom build steps ({step})")
for custom_step in config.custom_build_steps[step]:
outputs = cast(List[str | Path], custom_step.get("outputs"))
outputs = cast(List[Union[str, Path]], custom_step.get("outputs"))
if isinstance(outputs, list):
implicit.extend(outputs)
@@ -1589,7 +1589,7 @@ def generate_objdiff_config(
"build_ctx": True,
}
)
category_opt: List[str] | str = obj.options["progress_category"]
category_opt: Union[List[str], str] = obj.options["progress_category"]
if isinstance(category_opt, list):
progress_categories.extend(category_opt)
elif category_opt is not None: