ci: Move check_manifests step to ci-windows-cross.py
This is almost a refactor. The only change is putting the bitcoind.manifest into a different folder.
This commit is contained in:
2 files changed
+32
-17
No files matched your search
@@ -24,16 +24,47 @@ def print_version():
|
|||||||
run([str(bitcoind), "-version"])
|
run([str(bitcoind), "-version"])
|
||||||
|
|
||||||
|
|
||||||
|
def check_manifests():
|
||||||
|
release_dir = Path.cwd() / "bin"
|
||||||
|
manifest_path = release_dir / "bitcoind.manifest"
|
||||||
|
|
||||||
|
cmd_bitcoind_manifest = [
|
||||||
|
"mt.exe",
|
||||||
|
"-nologo",
|
||||||
|
f"-inputresource:{release_dir / 'bitcoind.exe'}",
|
||||||
|
f"-out:{manifest_path}",
|
||||||
|
]
|
||||||
|
run(cmd_bitcoind_manifest)
|
||||||
|
print(manifest_path.read_text())
|
||||||
|
|
||||||
|
skipped = { # Skip as they currently do not have manifests
|
||||||
|
"fuzz.exe",
|
||||||
|
"bench_bitcoin.exe",
|
||||||
|
"test_kernel.exe",
|
||||||
|
}
|
||||||
|
for entry in release_dir.iterdir():
|
||||||
|
if entry.suffix.lower() != ".exe":
|
||||||
|
continue
|
||||||
|
if entry.name in skipped:
|
||||||
|
print(f"Skipping {entry.name} (no manifest present)")
|
||||||
|
continue
|
||||||
|
print(f"Checking {entry.name}")
|
||||||
|
run(["mt.exe", "-nologo", f"-inputresource:{entry}", "-validate_manifest"])
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
parser = argparse.ArgumentParser(description="Utility to run Windows CI steps.")
|
parser = argparse.ArgumentParser(description="Utility to run Windows CI steps.")
|
||||||
steps = [
|
steps = [
|
||||||
"print_version",
|
"print_version",
|
||||||
|
"check_manifests",
|
||||||
]
|
]
|
||||||
parser.add_argument("step", choices=steps, help="CI step to perform.")
|
parser.add_argument("step", choices=steps, help="CI step to perform.")
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if args.step == "print_version":
|
if args.step == "print_version":
|
||||||
print_version()
|
print_version()
|
||||||
|
elif args.step == "check_manifests":
|
||||||
|
check_manifests()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
@@ -412,23 +412,7 @@ jobs:
|
|||||||
- *SET_UP_VS
|
- *SET_UP_VS
|
||||||
|
|
||||||
- name: Check executable manifests
|
- name: Check executable manifests
|
||||||
shell: pwsh -Command "$PSVersionTable; $PSNativeCommandUseErrorActionPreference = $true; $ErrorActionPreference = 'Stop'; & '{0}'"
|
run: py -3 .github/ci-windows-cross.py check_manifests
|
||||||
run: |
|
|
||||||
mt.exe -nologo -inputresource:bin\bitcoind.exe -out:bitcoind.manifest
|
|
||||||
Get-Content bitcoind.manifest
|
|
||||||
|
|
||||||
Get-ChildItem -Filter "bin\*.exe" | ForEach-Object {
|
|
||||||
$exeName = $_.Name
|
|
||||||
|
|
||||||
# Skip as they currently do not have manifests
|
|
||||||
if ($exeName -eq "fuzz.exe" -or $exeName -eq "bench_bitcoin.exe" -or $exeName -eq "test_kernel.exe") {
|
|
||||||
Write-Host "Skipping $exeName (no manifest present)"
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
Write-Host "Checking $exeName"
|
|
||||||
& mt.exe -nologo -inputresource:$_.FullName -validate_manifest
|
|
||||||
}
|
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
# Can't use ctest here like other jobs as we don't have a CMake build tree.
|
# Can't use ctest here like other jobs as we don't have a CMake build tree.
|
||||||
|
|||||||
Reference in new issue
Block a user