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:
Jeremy 2024-02-27 19:51:52 -06:00
parent e0b50c96b4
commit 6e01f7225d
No known key found for this signature in database
GPG Key ID: 19AA8270105E8EB4
2 changed files with 219 additions and 129 deletions

View File

@ -23,7 +23,7 @@ jobs:
cpptrace/ci/setup-prerequisites.sh
- name: build
run: |
python3 ci/build-in-all-configs.py --${{matrix.compiler}}
python3 ci/build-in-all-configs.py --${{matrix.compiler}} --default-config
build-macos:
runs-on: macos-14
strategy:
@ -41,7 +41,7 @@ jobs:
cpptrace/ci/setup-prerequisites.sh
- name: build
run: |
python3 ci/build-in-all-configs.py --${{matrix.compiler}}
python3 ci/build-in-all-configs.py --${{matrix.compiler}} --default-config
build-windows:
runs-on: windows-2022
strategy:
@ -50,6 +50,68 @@ jobs:
compiler: [msvc, clang, gcc]
steps:
- 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
uses: ilammy/msvc-dev-cmd@v1.13.0
- name: dependencies

View File

@ -138,35 +138,7 @@ def build_full_or_auto(matrix):
return succeeded
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"
)
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")
def run_linux_matrix(compilers: list):
matrix = {
"compiler": compilers,
"target": ["Debug"],
@ -191,6 +163,8 @@ def main():
}
exclude = []
run_matrix(matrix, exclude, build)
def run_linux_default(compilers: list):
matrix = {
"compiler": compilers,
"target": ["Debug"],
@ -199,12 +173,8 @@ def main():
}
exclude = []
run_matrix(matrix, exclude, build_full_or_auto)
if platform.system() == "Darwin":
compilers = []
if args.clang or args.all:
compilers.append("clang++")
if args.gcc or args.all:
compilers.append("g++-12")
def run_macos_matrix(compilers: list):
matrix = {
"compiler": compilers,
"target": ["Debug"],
@ -228,6 +198,8 @@ def main():
}
exclude = []
run_matrix(matrix, exclude, build)
def run_macos_default(compilers: list):
matrix = {
"compiler": compilers,
"target": ["Debug"],
@ -236,14 +208,8 @@ def main():
}
exclude = []
run_matrix(matrix, exclude, build_full_or_auto)
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++")
def run_windows_matrix(compilers: list):
matrix = {
"compiler": compilers,
"target": ["Debug"],
@ -300,6 +266,8 @@ def main():
},
]
run_matrix(matrix, exclude, build)
def run_windows_default(compilers: list):
matrix = {
"compiler": compilers,
"target": ["Debug"],
@ -309,6 +277,66 @@ def main():
exclude = []
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
if failed:
print("🔴 Some checks failed")