Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: consolidate configurations #411

Merged
merged 16 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 49 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,67 @@ jobs:
with:
key: ${{ github.job }}-ubuntu-latest
variant: sccache
- uses: seanmiddleditch/gha-setup-ninja@16b940825621068d98711680b6c3ff92201f8fc0 # v3
- uses: lukka/run-cmake@c2b72aff009141774c5a5fabe74ea46c8c04d9c4 # v10.6
with:
configurePreset: "ContinuousIntegration"
buildPreset: "ContinuousIntegrationWithPackage"
testPreset: "ContinuousIntegration"
configurePreset: "Host"
buildPreset: "Host-Debug-WithPackage"
testPreset: "Host"
configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER_LAUNCHER=sccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=sccache']"
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: emil
path: build/ContinuousIntegration/emil-*-Linux.tar.gz
path: build/Host/emil-*-Linux.tar.gz
if-no-files-found: error
- name: Upload test logs
if: ${{ failure() }}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: test-logs
path: build/ContinuousIntegration/Testing/Temporary/
host_build_test:
path: build/Host/Testing/Temporary/
host_build_test_windows:
name: Host Build & Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, windows-2019]
os: [windows-latest, windows-2019]
include:
- visual-studio: "2022"
os: "windows-latest"
- visual-studio: "2019"
os: "windows-2019"
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with:
persist-credentials: false
- uses: ilammy/msvc-dev-cmd@cec98b9d092141f74527d0afa6feb2af698cfe89 # v1.12.1
with:
vsversion: ${{ matrix.visual-studio }}
- uses: lukka/run-vcpkg@abed23940f9d7bc267b0e1a21ee7b699a3794baa # v11.1
with:
vcpkgGitCommitId: 501db0f17ef6df184fcdbfbe0f87cde2313b6ab1 # 2023.04.15
- uses: hendrikmuhs/ccache-action@6d1841ec156c39a52b1b23a810da917ab98da1f4 # v1.2.10
with:
key: ${{ github.job }}-${{ matrix.os }}
variant: sccache
- uses: lukka/run-cmake@c2b72aff009141774c5a5fabe74ea46c8c04d9c4 # v10.6
with:
configurePreset: "Host"
buildPreset: "Host-Debug"
testPreset: "Host"
configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER_LAUNCHER=sccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=sccache']"
- name: Upload test logs
if: ${{ failure() }}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: test-logs
path: build/Host/Testing/Temporary/
host_build_test_macos:
name: Host Build & Test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with:
Expand All @@ -62,16 +100,16 @@ jobs:
variant: sccache
- uses: lukka/run-cmake@c2b72aff009141774c5a5fabe74ea46c8c04d9c4 # v10.6
with:
configurePreset: "ContinuousIntegration"
buildPreset: "ContinuousIntegration"
testPreset: "ContinuousIntegration"
configurePreset: "Host-Single-Debug"
buildPreset: "Host-Single-Debug"
testPreset: "Host"
configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER_LAUNCHER=sccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=sccache']"
- name: Upload test logs
if: ${{ failure() }}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
name: test-logs
path: build/ContinuousIntegration/Testing/Temporary/
path: build/Host/Testing/Temporary/
embedded_build:
name: Embedded Build
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ jobs:
variant: sccache
- uses: lukka/run-cmake@c2b72aff009141774c5a5fabe74ea46c8c04d9c4 # v10.6
with:
configurePreset: "Package"
buildPreset: "Package"
configurePreset: "Host-Single-MinSizeRel"
buildPreset: "ReleasePackage"
configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER_LAUNCHER=sccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=sccache']"
- run: gh release upload ${{ needs.release_please.outputs.tag_name }} build/**/emil-*.zip --clobber
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ jobs:
with:
languages: cpp
- run: |
cmake --preset ContinuousIntegration -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build --preset ContinuousIntegration
cmake --preset Host -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build --preset Host-Debug
- uses: github/codeql-action/analyze@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8 # v2.21.5
103 changes: 50 additions & 53 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,38 @@
}
},
{
"name": "ContinuousIntegration",
"displayName": "Configuration for Continuous Integration",
"name": "Host",
"displayName": "Configuration for Host Tooling and Tests",
"inherits": "defaults",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"EMIL_ENABLE_DOCKER_TOOLS": "Off",
"CMAKE_CONFIGURATION_TYPES": "Debug;Release;RelWithDebInfo;MinSizeRel",
"EMIL_BUILD_TESTS": "On",
"EMIL_BUILD_EXAMPLES": "On"
},
"generator": "Ninja Multi-Config"
},
{
"name": "Host-Single-Debug",
"displayName": "Configuration for Host Tooling and Tests, Single Config Generator, Debug",
"inherits": "defaults",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"EMIL_ENABLE_DOCKER_TOOLS": "Off"
}
},
{
"name": "Package",
"displayName": "Configuration for CPack package generation",
"name": "Host-Single-MinSizeRel",
"displayName": "Configuration for Host Tooling and Tests, Single Config Generator, MinSizeRel",
"inherits": "defaults",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "MinSizeRel",
"EMIL_ENABLE_DOCKER_TOOLS": "Off",
"EMIL_BUILD_TESTS": "Off",
"EMIL_BUILD_EXAMPLES": "Off"
"EMIL_ENABLE_DOCKER_TOOLS": "Off"
}
},
{
"name": "Coverage",
"displayName": "Configuration for Code Coverage",
"inherits": "ContinuousIntegration",
"inherits": "Host",
"cacheVariables": {
"EMIL_ENABLE_COVERAGE": "On"
},
Expand All @@ -44,7 +52,7 @@
{
"name": "MutationTesting",
"displayName": "Configuration for Mutation Testing",
"inherits": "ContinuousIntegration",
"inherits": "Host",
"cacheVariables": {
"CMAKE_C_COMPILER": "clang-12",
"CMAKE_CXX_COMPILER": "clang++-12",
Expand All @@ -56,7 +64,7 @@
{
"name": "Fuzzing",
"displayName": "Configuration for Fuzzing",
"inherits": "ContinuousIntegration",
"inherits": "Host",
"cacheVariables": {
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++",
Expand All @@ -66,17 +74,6 @@
},
"generator": "Ninja"
},
{
"name": "Host",
"displayName": "Configuration for Host Tooling",
"inherits": "defaults",
"cacheVariables": {
"CMAKE_CONFIGURATION_TYPES": "Debug;Release;RelWithDebInfo;MinSizeRel",
"EMIL_BUILD_TESTS": "Off",
"EMIL_BUILD_EXAMPLES": "Off"
},
"generator": "Ninja Multi-Config"
},
{
"name": "HostClangMsvc",
"displayName": "Configuration for Host Tooling using clang-cl to target Windows",
Expand Down Expand Up @@ -121,21 +118,41 @@
],
"buildPresets": [
{
"name": "ContinuousIntegration",
"name": "Host-Debug",
"configuration": "Debug",
"configurePreset": "ContinuousIntegration"
"configurePreset": "Host"
},
{
"name": "ContinuousIntegrationWithPackage",
"name": "Host-Debug-WithPackage",
"configuration": "Debug",
"configurePreset": "ContinuousIntegration",
"targets": ["all", "package"]
"configurePreset": "Host",
"targets": [ "all", "package" ]
richardapeters marked this conversation as resolved.
Show resolved Hide resolved
},
{
"name": "Package",
"name": "Host-Release",
"configuration": "Release",
"configurePreset": "Host"
},
{
"name": "Host-RelWithDebInfo",
"configuration": "RelWithDebInfo",
"configurePreset": "Host"
},
{
"name": "Host-MinSizeRel",
"configuration": "MinSizeRel",
"configurePreset": "Host"
},
{
"name": "Host-Single-Debug",
"configuration": "Debug",
"configurePreset": "Host-Single-Debug"
},
{
"name": "ReleasePackage",
"configuration": "MinSizeRel",
"configurePreset": "Package",
"targets": ["package"]
"configurePreset": "Host-Single-MinSizeRel",
"targets": [ "package" ]
richardapeters marked this conversation as resolved.
Show resolved Hide resolved
},
{
"name": "Coverage",
Expand All @@ -152,26 +169,6 @@
"configuration": "Debug",
"configurePreset": "Fuzzing"
},
{
"name": "Host-Debug",
"configuration": "Debug",
"configurePreset": "Host"
},
{
"name": "Host-Release",
"configuration": "Release",
"configurePreset": "Host"
},
{
"name": "Host-RelWithDebInfo",
"configuration": "RelWithDebInfo",
"configurePreset": "Host"
},
{
"name": "Host-MinSizeRel",
"configuration": "MinSizeRel",
"configurePreset": "Host"
},
{
"name": "HostClangMsvc-Debug",
"configuration": "Debug",
Expand Down Expand Up @@ -226,8 +223,8 @@
}
},
{
"name": "ContinuousIntegration",
"configurePreset": "ContinuousIntegration",
"name": "Host",
"configurePreset": "Host",
"configuration": "Debug",
"inherits": "defaults"
},
Expand Down
Loading