Try to rework ci to test first the default configuration, then test all configs after that passes. Also refactor the build in all tests script.
This commit is contained in:
parent
e0b50c96b4
commit
6e01f7225d
66
.github/workflows/build.yml
vendored
66
.github/workflows/build.yml
vendored
@ -23,7 +23,7 @@ jobs:
|
|||||||
cpptrace/ci/setup-prerequisites.sh
|
cpptrace/ci/setup-prerequisites.sh
|
||||||
- name: build
|
- name: build
|
||||||
run: |
|
run: |
|
||||||
python3 ci/build-in-all-configs.py --${{matrix.compiler}}
|
python3 ci/build-in-all-configs.py --${{matrix.compiler}} --default-config
|
||||||
build-macos:
|
build-macos:
|
||||||
runs-on: macos-14
|
runs-on: macos-14
|
||||||
strategy:
|
strategy:
|
||||||
@ -41,7 +41,7 @@ jobs:
|
|||||||
cpptrace/ci/setup-prerequisites.sh
|
cpptrace/ci/setup-prerequisites.sh
|
||||||
- name: build
|
- name: build
|
||||||
run: |
|
run: |
|
||||||
python3 ci/build-in-all-configs.py --${{matrix.compiler}}
|
python3 ci/build-in-all-configs.py --${{matrix.compiler}} --default-config
|
||||||
build-windows:
|
build-windows:
|
||||||
runs-on: windows-2022
|
runs-on: windows-2022
|
||||||
strategy:
|
strategy:
|
||||||
@ -50,6 +50,68 @@ jobs:
|
|||||||
compiler: [msvc, clang, gcc]
|
compiler: [msvc, clang, gcc]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- name: Enable Developer Command Prompt
|
||||||
|
uses: ilammy/msvc-dev-cmd@v1.13.0
|
||||||
|
- name: dependencies
|
||||||
|
run: |
|
||||||
|
pip3 install colorama
|
||||||
|
- name: libdwarf
|
||||||
|
run: |
|
||||||
|
if("${{matrix.compiler}}" -eq "gcc") {
|
||||||
|
cd ..
|
||||||
|
cpptrace/ci/setup-prerequisites-mingw.ps1
|
||||||
|
}
|
||||||
|
- name: build
|
||||||
|
run: |
|
||||||
|
python3 ci/build-in-all-configs.py --${{matrix.compiler}} --default-config
|
||||||
|
build-linux-all-configurations:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
needs: build-linux
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
compiler: [gcc, clang]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt install gcc-10 g++-10 libgcc-10-dev libunwind8-dev
|
||||||
|
pip3 install colorama
|
||||||
|
- name: libdwarf
|
||||||
|
run: |
|
||||||
|
cd ..
|
||||||
|
cpptrace/ci/setup-prerequisites.sh
|
||||||
|
- name: build
|
||||||
|
run: |
|
||||||
|
python3 ci/build-in-all-configs.py --${{matrix.compiler}}
|
||||||
|
build-macos-all-configurations:
|
||||||
|
runs-on: macos-14
|
||||||
|
needs: build-macos
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
compiler: [gcc, clang]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: dependencies
|
||||||
|
run: |
|
||||||
|
pip3 install colorama
|
||||||
|
- name: libdwarf
|
||||||
|
run: |
|
||||||
|
cd ..
|
||||||
|
cpptrace/ci/setup-prerequisites.sh
|
||||||
|
- name: build
|
||||||
|
run: |
|
||||||
|
python3 ci/build-in-all-configs.py --${{matrix.compiler}}
|
||||||
|
build-windows-all-configurations:
|
||||||
|
runs-on: windows-2022
|
||||||
|
needs: build-windows
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
compiler: [msvc, clang, gcc]
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
- name: Enable Developer Command Prompt
|
- name: Enable Developer Command Prompt
|
||||||
uses: ilammy/msvc-dev-cmd@v1.13.0
|
uses: ilammy/msvc-dev-cmd@v1.13.0
|
||||||
- name: dependencies
|
- name: dependencies
|
||||||
|
|||||||
@ -138,35 +138,7 @@ def build_full_or_auto(matrix):
|
|||||||
|
|
||||||
return succeeded
|
return succeeded
|
||||||
|
|
||||||
def main():
|
def run_linux_matrix(compilers: list):
|
||||||
parser = argparse.ArgumentParser(
|
|
||||||
prog="Build in all configs",
|
|
||||||
description="Try building the library in all possible configurations for the current host"
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
"--clang",
|
|
||||||
action="store_true"
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
"--gcc",
|
|
||||||
action="store_true"
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
"--msvc",
|
|
||||||
action="store_true"
|
|
||||||
)
|
|
||||||
parser.add_argument(
|
|
||||||
"--all",
|
|
||||||
action="store_true"
|
|
||||||
)
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
if platform.system() == "Linux":
|
|
||||||
compilers = []
|
|
||||||
if args.clang or args.all:
|
|
||||||
compilers.append("clang++-14")
|
|
||||||
if args.gcc or args.all:
|
|
||||||
compilers.append("g++-10")
|
|
||||||
matrix = {
|
matrix = {
|
||||||
"compiler": compilers,
|
"compiler": compilers,
|
||||||
"target": ["Debug"],
|
"target": ["Debug"],
|
||||||
@ -191,6 +163,8 @@ def main():
|
|||||||
}
|
}
|
||||||
exclude = []
|
exclude = []
|
||||||
run_matrix(matrix, exclude, build)
|
run_matrix(matrix, exclude, build)
|
||||||
|
|
||||||
|
def run_linux_default(compilers: list):
|
||||||
matrix = {
|
matrix = {
|
||||||
"compiler": compilers,
|
"compiler": compilers,
|
||||||
"target": ["Debug"],
|
"target": ["Debug"],
|
||||||
@ -199,12 +173,8 @@ def main():
|
|||||||
}
|
}
|
||||||
exclude = []
|
exclude = []
|
||||||
run_matrix(matrix, exclude, build_full_or_auto)
|
run_matrix(matrix, exclude, build_full_or_auto)
|
||||||
if platform.system() == "Darwin":
|
|
||||||
compilers = []
|
def run_macos_matrix(compilers: list):
|
||||||
if args.clang or args.all:
|
|
||||||
compilers.append("clang++")
|
|
||||||
if args.gcc or args.all:
|
|
||||||
compilers.append("g++-12")
|
|
||||||
matrix = {
|
matrix = {
|
||||||
"compiler": compilers,
|
"compiler": compilers,
|
||||||
"target": ["Debug"],
|
"target": ["Debug"],
|
||||||
@ -228,6 +198,8 @@ def main():
|
|||||||
}
|
}
|
||||||
exclude = []
|
exclude = []
|
||||||
run_matrix(matrix, exclude, build)
|
run_matrix(matrix, exclude, build)
|
||||||
|
|
||||||
|
def run_macos_default(compilers: list):
|
||||||
matrix = {
|
matrix = {
|
||||||
"compiler": compilers,
|
"compiler": compilers,
|
||||||
"target": ["Debug"],
|
"target": ["Debug"],
|
||||||
@ -236,14 +208,8 @@ def main():
|
|||||||
}
|
}
|
||||||
exclude = []
|
exclude = []
|
||||||
run_matrix(matrix, exclude, build_full_or_auto)
|
run_matrix(matrix, exclude, build_full_or_auto)
|
||||||
if platform.system() == "Windows":
|
|
||||||
compilers = []
|
def run_windows_matrix(compilers: list):
|
||||||
if args.clang or args.all:
|
|
||||||
compilers.append("clang++")
|
|
||||||
if args.msvc or args.all:
|
|
||||||
compilers.append("cl")
|
|
||||||
if args.gcc or args.all:
|
|
||||||
compilers.append("g++")
|
|
||||||
matrix = {
|
matrix = {
|
||||||
"compiler": compilers,
|
"compiler": compilers,
|
||||||
"target": ["Debug"],
|
"target": ["Debug"],
|
||||||
@ -300,6 +266,8 @@ def main():
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
run_matrix(matrix, exclude, build)
|
run_matrix(matrix, exclude, build)
|
||||||
|
|
||||||
|
def run_windows_default(compilers: list):
|
||||||
matrix = {
|
matrix = {
|
||||||
"compiler": compilers,
|
"compiler": compilers,
|
||||||
"target": ["Debug"],
|
"target": ["Debug"],
|
||||||
@ -309,6 +277,66 @@ def main():
|
|||||||
exclude = []
|
exclude = []
|
||||||
run_matrix(matrix, exclude, build_full_or_auto)
|
run_matrix(matrix, exclude, build_full_or_auto)
|
||||||
|
|
||||||
|
def main():
|
||||||
|
parser = argparse.ArgumentParser(
|
||||||
|
prog="Build in all configs",
|
||||||
|
description="Try building the library in all possible configurations for the current host"
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--clang",
|
||||||
|
action="store_true"
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--gcc",
|
||||||
|
action="store_true"
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--msvc",
|
||||||
|
action="store_true"
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--all",
|
||||||
|
action="store_true"
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--default-config",
|
||||||
|
action="store_true"
|
||||||
|
)
|
||||||
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
if platform.system() == "Linux":
|
||||||
|
compilers = []
|
||||||
|
if args.clang or args.all:
|
||||||
|
compilers.append("clang++-14")
|
||||||
|
if args.gcc or args.all:
|
||||||
|
compilers.append("g++-10")
|
||||||
|
if args.default_config:
|
||||||
|
run_linux_default(compilers)
|
||||||
|
else:
|
||||||
|
run_linux_matrix(compilers)
|
||||||
|
if platform.system() == "Darwin":
|
||||||
|
compilers = []
|
||||||
|
if args.clang or args.all:
|
||||||
|
compilers.append("clang++")
|
||||||
|
if args.gcc or args.all:
|
||||||
|
compilers.append("g++-12")
|
||||||
|
if args.default_config:
|
||||||
|
run_macos_default(compilers)
|
||||||
|
else:
|
||||||
|
run_macos_matrix(compilers)
|
||||||
|
if platform.system() == "Windows":
|
||||||
|
compilers = []
|
||||||
|
if args.clang or args.all:
|
||||||
|
compilers.append("clang++")
|
||||||
|
if args.msvc or args.all:
|
||||||
|
compilers.append("cl")
|
||||||
|
if args.gcc or args.all:
|
||||||
|
compilers.append("g++")
|
||||||
|
if args.default_config:
|
||||||
|
run_windows_default(compilers)
|
||||||
|
else:
|
||||||
|
run_windows_matrix(compilers)
|
||||||
|
|
||||||
global failed
|
global failed
|
||||||
if failed:
|
if failed:
|
||||||
print("🔴 Some checks failed")
|
print("🔴 Some checks failed")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user