mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-02 01:36:13 +00:00
ci: [refactor] Move config.ini rewrite to ci-windows-cross.py
This commit is contained in:
parent
faf7389466
commit
fac9c7bd66
23
.github/ci-windows-cross.py
vendored
23
.github/ci-windows-cross.py
vendored
@ -52,11 +52,32 @@ def check_manifests():
|
||||
run(["mt.exe", "-nologo", f"-inputresource:{entry}", "-validate_manifest"])
|
||||
|
||||
|
||||
def prepare_tests():
|
||||
workspace = Path.cwd()
|
||||
config_path = workspace / "test" / "config.ini"
|
||||
rpcauth_path = workspace / "share" / "rpcauth" / "rpcauth.py"
|
||||
replacements = {
|
||||
"SRCDIR=": f"SRCDIR={workspace}",
|
||||
"BUILDDIR=": f"BUILDDIR={workspace}",
|
||||
"RPCAUTH=": f"RPCAUTH={rpcauth_path}",
|
||||
}
|
||||
lines = config_path.read_text().splitlines()
|
||||
for index, line in enumerate(lines):
|
||||
for prefix, new_value in replacements.items():
|
||||
if line.startswith(prefix):
|
||||
lines[index] = new_value
|
||||
break
|
||||
content = "\n".join(lines) + "\n"
|
||||
config_path.write_text(content)
|
||||
print(content)
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Utility to run Windows CI steps.")
|
||||
steps = [
|
||||
"print_version",
|
||||
"check_manifests",
|
||||
"prepare_tests",
|
||||
]
|
||||
parser.add_argument("step", choices=steps, help="CI step to perform.")
|
||||
args = parser.parse_args()
|
||||
@ -65,6 +86,8 @@ def main():
|
||||
print_version()
|
||||
elif args.step == "check_manifests":
|
||||
check_manifests()
|
||||
elif args.step == "prepare_tests":
|
||||
prepare_tests()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
@ -426,10 +426,7 @@ jobs:
|
||||
./src/univalue/unitester.exe
|
||||
|
||||
- name: Adjust paths in test/config.ini
|
||||
shell: pwsh
|
||||
run: |
|
||||
(Get-Content "test/config.ini") -replace '(?<=^SRCDIR=).*', '${{ github.workspace }}' -replace '(?<=^BUILDDIR=).*', '${{ github.workspace }}' -replace '(?<=^RPCAUTH=).*', '${{ github.workspace }}/share/rpcauth/rpcauth.py' | Set-Content "test/config.ini"
|
||||
Get-Content "test/config.ini"
|
||||
run: py -3 .github/ci-windows-cross.py prepare_tests
|
||||
|
||||
- name: Set previous release directory
|
||||
run: |
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user