diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d947979..8688b15 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,6 +7,10 @@ on: jobs: build-linux: runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + compiler: [gcc, clang] steps: - uses: actions/checkout@v2 - name: dependencies @@ -30,9 +34,13 @@ jobs: cd ../../cpptrace - name: build run: | - python3 ci/build-in-all-configs.py + python3 ci/build-in-all-configs.py --${{matrix.compiler}} build-macos: runs-on: macos-13 + strategy: + fail-fast: false + matrix: + compiler: [gcc, clang] steps: - uses: actions/checkout@v2 - name: dependencies @@ -55,9 +63,13 @@ jobs: cd ../../cpptrace - name: build run: | - python3 ci/build-in-all-configs.py - build-windows-msvc: + python3 ci/build-in-all-configs.py --${{matrix.compiler}} + build-windows: runs-on: windows-2019 + strategy: + fail-fast: false + matrix: + compiler: [msvc, clang, gcc] steps: - uses: actions/checkout@v2 - name: Enable Developer Command Prompt @@ -76,62 +88,15 @@ jobs: git checkout FETCH_HEAD mkdir build cd build - cmake .. -DPIC_ALWAYS=TRUE -DBUILD_DWARFDUMP=FALSE - msbuild INSTALL.vcxproj + if("${{matrix.compiler}}" -eq "gcc") { + cmake .. -DPIC_ALWAYS=TRUE -DBUILD_DWARFDUMP=FALSE -G"Unix Makefiles" + make -j + make install + } else { + cmake .. -DPIC_ALWAYS=TRUE -DBUILD_DWARFDUMP=FALSE + msbuild INSTALL.vcxproj + } cd ../../cpptrace - name: build run: | - python3 ci/build-in-all-configs.py --msvc-only - build-windows-clang: - runs-on: windows-2019 - steps: - - uses: actions/checkout@v2 - - name: Enable Developer Command Prompt - uses: ilammy/msvc-dev-cmd@v1.10.0 - - name: dependencies - run: | - pip3 install colorama - - name: libdwarf - run: | - cd .. - mkdir libdwarf - cd libdwarf - git init - git remote add origin https://github.com/jeremy-rifkin/libdwarf-code.git - git fetch --depth 1 origin 6216e185863f41d6f19ab850caabfff7326020d7 - git checkout FETCH_HEAD - mkdir build - cd build - cmake .. -DPIC_ALWAYS=TRUE -DBUILD_DWARFDUMP=FALSE - msbuild INSTALL.vcxproj - cd ../../cpptrace - - name: build - run: | - python3 ci/build-in-all-configs.py --clang-only - build-windows-mingw: - runs-on: windows-2019 - steps: - - uses: actions/checkout@v2 - - name: Enable Developer Command Prompt - uses: ilammy/msvc-dev-cmd@v1.10.0 - - name: dependencies - run: | - pip3 install colorama - - name: libdwarf - run: | - cd .. - mkdir libdwarf - cd libdwarf - git init - git remote add origin https://github.com/jeremy-rifkin/libdwarf-code.git - git fetch --depth 1 origin 6216e185863f41d6f19ab850caabfff7326020d7 - git checkout FETCH_HEAD - mkdir build - cd build - cmake .. -DPIC_ALWAYS=TRUE -DBUILD_DWARFDUMP=FALSE -G"Unix Makefiles" - make -j - make install - cd ../../cpptrace - - name: build - run: | - python3 ci/build-in-all-configs.py --mingw-only + python3 ci/build-in-all-configs.py --${{matrix.compiler}} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 79666e4..3e5edbb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,6 +9,10 @@ on: jobs: test-linux: runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + compiler: [gcc, clang] steps: - uses: actions/checkout@v2 - name: dependencies @@ -32,9 +36,13 @@ jobs: cd ../../cpptrace - name: build and test run: | - python3 ci/test-all-configs.py + python3 ci/test-all-configs.py --${{matrix.compiler}} test-macos: runs-on: macos-13 + strategy: + fail-fast: false + matrix: + compiler: [gcc, clang] steps: - uses: actions/checkout@v2 - name: libdwarf @@ -57,9 +65,13 @@ jobs: pip3 install colorama - name: build and test run: | - python3 ci/test-all-configs.py - test-windows-msvc: + python3 ci/test-all-configs.py --${{matrix.compiler}} + test-windows: runs-on: windows-2019 + strategy: + fail-fast: false + matrix: + compiler: [msvc, clang, gcc] steps: - uses: actions/checkout@v2 - name: Enable Developer Command Prompt @@ -78,62 +90,15 @@ jobs: git checkout FETCH_HEAD mkdir build cd build - cmake .. -DPIC_ALWAYS=TRUE -DBUILD_DWARFDUMP=FALSE - msbuild INSTALL.vcxproj + if("${{matrix.compiler}}" -eq "gcc") { + cmake .. -DPIC_ALWAYS=TRUE -DBUILD_DWARFDUMP=FALSE -G"Unix Makefiles" + make -j + make install + } else { + cmake .. -DPIC_ALWAYS=TRUE -DBUILD_DWARFDUMP=FALSE + msbuild INSTALL.vcxproj + } cd ../../cpptrace - name: build and test run: | - python3 ci/test-all-configs.py --msvc-only - test-windows-clang: - runs-on: windows-2019 - steps: - - uses: actions/checkout@v2 - - name: Enable Developer Command Prompt - uses: ilammy/msvc-dev-cmd@v1.10.0 - - name: dependencies - run: | - pip3 install colorama - - name: libdwarf - run: | - cd .. - mkdir libdwarf - cd libdwarf - git init - git remote add origin https://github.com/jeremy-rifkin/libdwarf-code.git - git fetch --depth 1 origin 6216e185863f41d6f19ab850caabfff7326020d7 - git checkout FETCH_HEAD - mkdir build - cd build - cmake .. -DPIC_ALWAYS=TRUE -DBUILD_DWARFDUMP=FALSE - msbuild INSTALL.vcxproj - cd ../../cpptrace - - name: build and test - run: | - python3 ci/test-all-configs.py --clang-only - test-windows-mingw: - runs-on: windows-2019 - steps: - - uses: actions/checkout@v2 - - name: Enable Developer Command Prompt - uses: ilammy/msvc-dev-cmd@v1.10.0 - - name: dependencies - run: | - pip3 install colorama - - name: libdwarf - run: | - cd .. - mkdir libdwarf - cd libdwarf - git init - git remote add origin https://github.com/jeremy-rifkin/libdwarf-code.git - git fetch --depth 1 origin 6216e185863f41d6f19ab850caabfff7326020d7 - git checkout FETCH_HEAD - mkdir build - cd build - cmake .. -DPIC_ALWAYS=TRUE -DBUILD_DWARFDUMP=FALSE -G"Unix Makefiles" - make -j - make install - cd ../../cpptrace - - name: build and test - run: | - python3 ci/test-all-configs.py --mingw-only + python3 ci/test-all-configs.py --${{matrix.compiler}} diff --git a/ci/build-in-all-configs.py b/ci/build-in-all-configs.py index 6a6128e..90bc093 100644 --- a/ci/build-in-all-configs.py +++ b/ci/build-in-all-configs.py @@ -142,10 +142,32 @@ def main(): 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 = { - "compiler": ["g++-10", "clang++-14"], + "compiler": compilers, "target": ["Debug"], "std": ["11", "20"], "unwind": [ @@ -169,7 +191,7 @@ def main(): exclude = [] run_matrix(matrix, exclude, build) matrix = { - "compiler": ["g++-10", "clang++-14"], + "compiler": compilers, "target": ["Debug"], "std": ["11", "20"], "config": [""] @@ -177,8 +199,13 @@ 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") matrix = { - "compiler": ["g++-12", "clang++"], + "compiler": compilers, "target": ["Debug"], "std": ["11", "20"], "unwind": [ @@ -201,7 +228,7 @@ def main(): exclude = [] run_matrix(matrix, exclude, build) matrix = { - "compiler": ["g++-12", "clang++"], + "compiler": compilers, "target": ["Debug"], "std": ["11", "20"], "config": [""] @@ -209,28 +236,13 @@ def main(): exclude = [] run_matrix(matrix, exclude, build_full_or_auto) if platform.system() == "Windows": - parser.add_argument( - "--clang-only", - action="store_true" - ) - parser.add_argument( - "--msvc-only", - action="store_true" - ) - parser.add_argument( - "--mingw-only", - action="store_true" - ) - args = parser.parse_args() - - compilers = ["cl", "clang++", "g++"] - if args.clang_only: - compilers = ["clang++"] - if args.msvc_only: - compilers = ["cl"] - if args.mingw_only: - compilers = ["g++"] - + 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++") matrix = { "compiler": compilers, "target": ["Debug"], diff --git a/ci/test-all-configs.py b/ci/test-all-configs.py index 2dfb9bb..6b9d668 100644 --- a/ci/test-all-configs.py +++ b/ci/test-all-configs.py @@ -310,10 +310,32 @@ def main(): 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 = { - "compiler": ["g++-10", "clang++-14"], + "compiler": compilers, "target": ["Debug"], "std": ["11", "20"], "unwind": [ @@ -338,7 +360,7 @@ def main(): exclude = [] run_matrix(matrix, exclude, build_and_test) matrix = { - "compiler": ["g++-10", "clang++-14"], + "compiler": compilers, "target": ["Debug"], "std": ["11", "20"], "config": [""] @@ -346,8 +368,13 @@ def main(): exclude = [] run_matrix(matrix, exclude, build_and_test_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") matrix = { - "compiler": ["g++-12", "clang++"], + "compiler": compilers, "target": ["Debug"], "std": ["11", "20"], "unwind": [ @@ -370,7 +397,7 @@ def main(): exclude = [] run_matrix(matrix, exclude, build_and_test) matrix = { - "compiler": ["g++-12", "clang++"], + "compiler": compilers, "target": ["Debug"], "std": ["11", "20"], "config": [""] @@ -378,28 +405,13 @@ def main(): exclude = [] run_matrix(matrix, exclude, build_and_test_full_or_auto) if platform.system() == "Windows": - parser.add_argument( - "--clang-only", - action="store_true" - ) - parser.add_argument( - "--msvc-only", - action="store_true" - ) - parser.add_argument( - "--mingw-only", - action="store_true" - ) - args = parser.parse_args() - - compilers = ["cl", "clang++", "g++"] - if args.clang_only: - compilers = ["clang++"] - if args.msvc_only: - compilers = ["cl"] - if args.mingw_only: - compilers = ["g++"] - + 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++") matrix = { "compiler": compilers, "target": ["Debug"],