Remove mostly redundant build workflow and turn the test workflow into a general ci workflow

This commit is contained in:
Jeremy Rifkin 2025-01-28 00:26:19 -06:00
parent 247474389f
commit 6971f6a5ca
No known key found for this signature in database
GPG Key ID: 19AA8270105E8EB4
3 changed files with 92 additions and 250 deletions

View File

@ -1,145 +0,0 @@
name: build
on:
push:
pull_request:
jobs:
build-linux:
runs-on: ubuntu-22.04
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 ninja-build
pip3 install colorama
- name: libdwarf
run: |
cd ..
cpptrace/ci/setup-prerequisites.sh
- name: build
run: |
python3 ci/build-in-all-configs.py --${{matrix.compiler}} --default-config
build-linux-bazel:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: dependencies
run: |
sudo apt install -y libtool libncurses5
- name: bazel build opt
run: |
bazel build //... -c opt
- name: bazel build dbg
run: |
bazel build //... -c dbg
build-macos:
runs-on: macos-14
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
steps:
- uses: actions/checkout@v4
- name: dependencies
run: |
brew install ninja
python3 -m venv env
env/bin/pip install colorama
- name: libdwarf
run: |
cd ..
cpptrace/ci/setup-prerequisites.sh
- name: build
run: |
env/bin/python ci/build-in-all-configs.py --${{matrix.compiler}} --default-config
build-windows:
runs-on: windows-2022
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
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 ninja-build
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: |
brew install ninja
python3 -m venv env
env/bin/pip install colorama
- name: libdwarf
run: |
cd ..
cpptrace/ci/setup-prerequisites.sh
- name: build
run: |
env/bin/python 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
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}}

View File

@ -1,4 +1,4 @@
name: test
name: ci
on:
push:
@ -136,6 +136,72 @@ jobs:
python3 ci/test-all-configs.py --${{matrix.compiler}}
build-linux-all-remaining-configurations:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
needs: test-linux-all-configurations
steps:
- uses: actions/checkout@v4
- name: dependencies
run: |
sudo apt install gcc-10 g++-10 libgcc-10-dev libunwind8-dev ninja-build
pip3 install colorama
- name: libdwarf
run: |
cd ..
cpptrace/ci/setup-prerequisites.sh
- name: build
run: |
python3 ci/build-in-all-remaining-configs.py --${{matrix.compiler}}
build-macos-all-remaining-configurations:
runs-on: macos-14
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
needs: test-macos-all-configurations
steps:
- uses: actions/checkout@v4
- name: dependencies
run: |
brew install ninja
python3 -m venv env
env/bin/pip install colorama
- name: libdwarf
run: |
cd ..
cpptrace/ci/setup-prerequisites.sh
- name: build
run: |
env/bin/python ci/build-in-all-remaining-configs.py --${{matrix.compiler}}
build-windows-all-remaining-configurations:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
compiler: [msvc, clang, gcc]
needs: test-windows-all-configurations
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-remaining-configs.py --${{matrix.compiler}}
unittest-linux:
runs-on: ubuntu-24.04
strategy:

View File

@ -127,37 +127,26 @@ def run_linux_matrix(compilers: list):
"target": ["Debug"],
"std": ["11", "20"],
"unwind": [
"CPPTRACE_UNWIND_WITH_UNWIND",
"CPPTRACE_UNWIND_WITH_EXECINFO",
"CPPTRACE_UNWIND_WITH_LIBUNWIND",
# "CPPTRACE_UNWIND_WITH_UNWIND",
# "CPPTRACE_UNWIND_WITH_EXECINFO",
# "CPPTRACE_UNWIND_WITH_LIBUNWIND",
"CPPTRACE_UNWIND_WITH_NOTHING",
],
"symbols": [
"CPPTRACE_GET_SYMBOLS_WITH_LIBBACKTRACE",
"CPPTRACE_GET_SYMBOLS_WITH_LIBDL",
"CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF",
"CPPTRACE_GET_SYMBOLS_WITH_ADDR2LINE",
# "CPPTRACE_GET_SYMBOLS_WITH_LIBDL",
# "CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF",
# "CPPTRACE_GET_SYMBOLS_WITH_ADDR2LINE",
"CPPTRACE_GET_SYMBOLS_WITH_NOTHING",
],
"demangle": [
"CPPTRACE_DEMANGLE_WITH_CXXABI",
# "CPPTRACE_DEMANGLE_WITH_CXXABI",
"CPPTRACE_DEMANGLE_WITH_NOTHING",
],
},
exclude = []
).run(build)
def run_linux_default(compilers: list):
MatrixRunner(
matrix = {
"compiler": compilers,
"target": ["Debug"],
"std": ["11", "20"],
"config": [""]
},
exclude = []
).run(build_full_or_auto)
def run_macos_matrix(compilers: list):
MatrixRunner(
matrix = {
@ -165,36 +154,25 @@ def run_macos_matrix(compilers: list):
"target": ["Debug"],
"std": ["11", "20"],
"unwind": [
"CPPTRACE_UNWIND_WITH_UNWIND",
"CPPTRACE_UNWIND_WITH_EXECINFO",
# "CPPTRACE_UNWIND_WITH_UNWIND",
# "CPPTRACE_UNWIND_WITH_EXECINFO",
"CPPTRACE_UNWIND_WITH_NOTHING",
],
"symbols": [
#"CPPTRACE_GET_SYMBOLS_WITH_LIBBACKTRACE",
"CPPTRACE_GET_SYMBOLS_WITH_LIBDL",
"CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF",
"CPPTRACE_GET_SYMBOLS_WITH_ADDR2LINE",
# "CPPTRACE_GET_SYMBOLS_WITH_LIBBACKTRACE",
# "CPPTRACE_GET_SYMBOLS_WITH_LIBDL",
# "CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF",
# "CPPTRACE_GET_SYMBOLS_WITH_ADDR2LINE",
"CPPTRACE_GET_SYMBOLS_WITH_NOTHING",
],
"demangle": [
"CPPTRACE_DEMANGLE_WITH_CXXABI",
# "CPPTRACE_DEMANGLE_WITH_CXXABI",
"CPPTRACE_DEMANGLE_WITH_NOTHING",
]
},
exclude = []
).run(build)
def run_macos_default(compilers: list):
MatrixRunner(
matrix = {
"compiler": compilers,
"target": ["Debug"],
"std": ["11", "20"],
"config": [""]
},
exclude = []
).run(build_full_or_auto)
def run_windows_matrix(compilers: list):
MatrixRunner(
matrix = {
@ -202,68 +180,24 @@ def run_windows_matrix(compilers: list):
"target": ["Debug"],
"std": ["11", "20"],
"unwind": [
"CPPTRACE_UNWIND_WITH_WINAPI",
"CPPTRACE_UNWIND_WITH_DBGHELP",
"CPPTRACE_UNWIND_WITH_UNWIND",
# "CPPTRACE_UNWIND_WITH_WINAPI",
# "CPPTRACE_UNWIND_WITH_DBGHELP",
# "CPPTRACE_UNWIND_WITH_UNWIND",
"CPPTRACE_UNWIND_WITH_NOTHING",
],
"symbols": [
"CPPTRACE_GET_SYMBOLS_WITH_DBGHELP",
"CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF",
"CPPTRACE_GET_SYMBOLS_WITH_ADDR2LINE",
# "CPPTRACE_GET_SYMBOLS_WITH_DBGHELP",
# "CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF",
# "CPPTRACE_GET_SYMBOLS_WITH_ADDR2LINE",
"CPPTRACE_GET_SYMBOLS_WITH_NOTHING",
],
"demangle": [
#"CPPTRACE_DEMANGLE_WITH_CXXABI",
# "CPPTRACE_DEMANGLE_WITH_CXXABI",
"CPPTRACE_DEMANGLE_WITH_NOTHING",
]
},
exclude = [
{
"demangle": "CPPTRACE_DEMANGLE_WITH_CXXABI",
"compiler": "cl"
},
{
"unwind": "CPPTRACE_UNWIND_WITH_UNWIND",
"compiler": "cl"
},
{
"unwind": "CPPTRACE_UNWIND_WITH_UNWIND",
"compiler": "clang++"
},
{
"symbols": "CPPTRACE_GET_SYMBOLS_WITH_ADDR2LINE",
"compiler": "cl"
},
{
"symbols": "CPPTRACE_GET_SYMBOLS_WITH_ADDR2LINE",
"compiler": "clang++"
},
{
"symbols": "CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF",
"compiler": "cl"
},
{
"symbols": "CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF",
"compiler": "clang++"
},
{
"symbols": "CPPTRACE_GET_SYMBOLS_WITH_DBGHELP",
"compiler": "g++"
},
]
).run(build)
def run_windows_default(compilers: list):
MatrixRunner(
matrix = {
"compiler": compilers,
"target": ["Debug"],
"std": ["11", "20"],
"config": [""]
},
exclude = []
).run(build_full_or_auto)
).run(build)
def main():
parser = argparse.ArgumentParser(
@ -286,10 +220,6 @@ def main():
"--all",
action="store_true"
)
parser.add_argument(
"--default-config",
action="store_true"
)
args = parser.parse_args()
if platform.system() == "Linux":
@ -298,20 +228,14 @@ def main():
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)
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)
run_macos_matrix(compilers)
if platform.system() == "Windows":
compilers = []
if args.clang or args.all:
@ -320,9 +244,6 @@ def main():
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)
run_windows_matrix(compilers)
main()