Skip to content

Commit

Permalink
ci: separate builds for different formatting options enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
mpusz committed Jan 23, 2024
1 parent fcadaf5 commit d67de61
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/ci-conan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ env:

jobs:
build:
name: "C++${{ matrix.std }} ${{ matrix.config.name }} ${{ matrix.build_type }}"
name: "${{ matrix.formatting }} C++${{ matrix.std }} ${{ matrix.config.name }} ${{ matrix.build_type }}"
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
formatting: ["std::format", "fmtlib"]
std: [20, 23]
config:
# - {
Expand All @@ -65,6 +66,7 @@ jobs:
cxx: "g++-12",
},
cxx_modules: "False",
std_format_support: "False",
conan-config: "",
}
- {
Expand All @@ -78,6 +80,7 @@ jobs:
cxx: "g++-13",
},
cxx_modules: "False",
std_format_support: "True",
conan-config: "",
}
- {
Expand All @@ -92,6 +95,7 @@ jobs:
},
lib: "libc++",
cxx_modules: "False",
std_format_support: "True",
conan-config: "",
}
- {
Expand All @@ -106,6 +110,7 @@ jobs:
},
lib: "libc++",
cxx_modules: "True",
std_format_support: "True",
conan-config: "",
}
- {
Expand All @@ -119,9 +124,13 @@ jobs:
cxx: "clang++",
},
cxx_modules: "False",
std_format_support: "True",
conan-config: "",
}
build_type: ["Release", "Debug"]
exclude:
- formatting: "std::format"
std_format_support: "False"

env:
CC: ${{ matrix.config.compiler.cc }}
Expand Down Expand Up @@ -196,12 +205,13 @@ jobs:
sed -i.backup '/^\[settings\]$/,/^\[/ s/^compiler.cppstd=.*/compiler.cppstd=${{ matrix.std }}/' ~/.conan2/profiles/default
sed -i.backup '/^\[settings\]$/,/^\[/ s/^build_type=.*/build_type=${{ matrix.build_type }}/' ~/.conan2/profiles/default
conan profile show -pr default
- run: echo "use_fmtlib=$([ "${{ matrix.formatting }}" == "fmtlib" ] && echo "True" || echo "False")" >> $GITHUB_ENV
- name: Create Conan package
shell: bash
run: |
conan create . --user mpusz --channel ${CHANNEL} --lockfile-out=package.lock \
-b mp-units/* -b missing -c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" \
-c user.build:all=True -o cxx_modules=${{ matrix.config.cxx_modules }} ${{ matrix.config.conan-config }}
-c user.build:all=True -o cxx_modules=${{ matrix.config.cxx_modules }} -o use_fmtlib=${{ env.use_fmtlib }} ${{ matrix.config.conan-config }}
- name: Obtain package reference
id: get-package-ref
shell: bash
Expand Down
15 changes: 13 additions & 2 deletions .github/workflows/ci-test-package-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ on:

jobs:
test_package:
name: "C++${{ matrix.std }} ${{ matrix.config.name }} ${{ matrix.build_type }}"
name: "${{ matrix.formatting }} C++${{ matrix.std }} ${{ matrix.config.name }} ${{ matrix.build_type }}"
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
formatting: ["std::format", "fmtlib"]
std: [20, 23]
config:
# - {
Expand All @@ -64,6 +65,7 @@ jobs:
cxx: "g++-12",
},
cxx_modules: "False",
std_format_support: "False",
}
- {
name: "GCC-13",
Expand All @@ -76,6 +78,7 @@ jobs:
cxx: "g++-13",
},
cxx_modules: "False",
std_format_support: "True",
}
- {
name: "Clang-16",
Expand All @@ -89,6 +92,7 @@ jobs:
},
lib: "libc++",
cxx_modules: "False",
std_format_support: "True",
}
- {
name: "Clang-17",
Expand All @@ -102,6 +106,7 @@ jobs:
},
lib: "libc++",
cxx_modules: "False",
std_format_support: "True",
}
- {
name: "Apple Clang 15",
Expand All @@ -114,8 +119,12 @@ jobs:
cxx: "clang++",
},
cxx_modules: "False",
std_format_support: "True",
}
build_type: ["Release", "Debug"]
exclude:
- formatting: "std::format"
std_format_support: "False"

env:
CC: ${{ matrix.config.compiler.cc }}
Expand Down Expand Up @@ -191,10 +200,12 @@ jobs:
sed -i.backup '/^\[settings\]$/,/^\[/ s/^compiler.cppstd=.*/compiler.cppstd=${{ matrix.std }}/' ~/.conan2/profiles/default
sed -i.backup '/^\[settings\]$/,/^\[/ s/^build_type=.*/build_type=${{ matrix.build_type }}/' ~/.conan2/profiles/default
conan profile show -pr default
- run: echo "use_fmtlib=$([ "${{ matrix.formatting }}" == "fmtlib" ] && echo "True" || echo "False")" >> $GITHUB_ENV
- name: Install Conan dependencies
shell: bash
run: |
conan install . -b missing -c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" -c user.build:all=False -o cxx_modules=${{ matrix.config.cxx_modules }}
conan install . -b missing -c tools.cmake.cmaketoolchain:generator="Ninja Multi-Config" -c user.build:all=False \
-o cxx_modules=${{ matrix.config.cxx_modules }} -o use_fmtlib=${{ env.use_fmtlib }}
mv CMakeUserPresets.json src
- name: Configure mp-units CMake
if: matrix.config.compiler.type == 'VISUAL' || matrix.config.compiler.type == 'MSVC'
Expand Down

0 comments on commit d67de61

Please sign in to comment.