mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-28 10:09:35 +01:00
ci: [refactor] Move print_version step into ci-windows-cross.py helper
This commit is contained in:
40
.github/ci-windows-cross.py
vendored
Executable file
40
.github/ci-windows-cross.py
vendored
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env python3
|
||||
# Copyright (c) The Bitcoin Core developers
|
||||
# Distributed under the MIT software license, see the accompanying
|
||||
# file COPYING or https://opensource.org/license/mit/.
|
||||
|
||||
import argparse
|
||||
import shlex
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def run(cmd, **kwargs):
|
||||
print("+ " + shlex.join(cmd), flush=True)
|
||||
kwargs.setdefault("check", True)
|
||||
try:
|
||||
return subprocess.run(cmd, **kwargs)
|
||||
except Exception as e:
|
||||
sys.exit(str(e))
|
||||
|
||||
|
||||
def print_version():
|
||||
bitcoind = Path.cwd() / "bin" / "bitcoind.exe"
|
||||
run([str(bitcoind), "-version"])
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(description="Utility to run Windows CI steps.")
|
||||
steps = [
|
||||
"print_version",
|
||||
]
|
||||
parser.add_argument("step", choices=steps, help="CI step to perform.")
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.step == "print_version":
|
||||
print_version()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -407,7 +407,7 @@ jobs:
|
||||
name: ${{ matrix.artifact-name }}-${{ github.run_id }}
|
||||
|
||||
- name: Run bitcoind.exe
|
||||
run: ./bin/bitcoind.exe -version
|
||||
run: py -3 .github/ci-windows-cross.py print_version
|
||||
|
||||
- *SET_UP_VS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user