Skip to content

Commit

Permalink
ci: consolidate configurations (#411)
Browse files Browse the repository at this point in the history
* ci: consolidate configurations

* Change Package config into Host-Single-MinSizeRel, split Windows/MacOS workflows

* Add Host-Single-Debug, use for MacOS ci

* Disable sccache for Windows build

* Consolidate Windows and MacOS builds

* Explicitly enable tests

* Apply suggestions from code review

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Use the correct configuration for the test preset

* Presets now start with a lower case character

* Presets now start with a lower case character

* Presets now start with a lower case character

* Update CMakePresets.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* .github/workflows/ci.yml: small improvements

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
richardapeters and github-actions[bot] authored Sep 20, 2023
1 parent 9582f91 commit 228d645
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 112 deletions.
6 changes: 3 additions & 3 deletions .clusterfuzzlite/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash -eu

cmake --preset Fuzzing
cmake --build --preset Fuzzing
cmake --preset fuzzing
cmake --build --preset fuzzing

cp build/Fuzzing/infra/syntax/fuzz/infra.syntax_json_fuzzer $OUT/infra-syntax_json_fuzzer
cp build/fuzzing/infra/syntax/fuzz/infra.syntax_json_fuzzer $OUT/infra-syntax_json_fuzzer
27 changes: 14 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,24 @@ 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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
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@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: test-logs
path: build/ContinuousIntegration/Testing/Temporary/
path: build/host/Testing/Temporary/
host_build_test:
name: Host Build & Test
runs-on: ${{ matrix.os }}
Expand All @@ -62,16 +63,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-single-Debug"
configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER_LAUNCHER=sccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=sccache']"
- name: Upload test logs
if: ${{ failure() }}
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
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 Expand Up @@ -99,8 +100,8 @@ jobs:
- run: mkdir install && mv emil-*/* install/
- uses: lukka/run-cmake@c2b72aff009141774c5a5fabe74ea46c8c04d9c4 # v10.6
with:
configurePreset: "Embedded"
buildPreset: "Embedded-${{ matrix.configuration }}"
configurePreset: "embedded"
buildPreset: "embedded-${{ matrix.configuration }}"
configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER_LAUNCHER=ccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=ccache']"
rtos:
name: Embedded Build - RTOS
Expand Down Expand Up @@ -128,6 +129,6 @@ jobs:
- run: mkdir install && mv emil-*/* install/
- uses: lukka/run-cmake@c2b72aff009141774c5a5fabe74ea46c8c04d9c4 # v10.6
with:
configurePreset: "Embedded-${{ matrix.rtos }}"
buildPreset: "Embedded-${{ matrix.rtos }}-RelWithDebInfo"
configurePreset: "embedded-${{ matrix.rtos }}"
buildPreset: "embedded-${{ matrix.rtos }}-RelWithDebInfo"
configurePresetAdditionalArgs: "['-DCMAKE_C_COMPILER_LAUNCHER=ccache', '-DCMAKE_CXX_COMPILER_LAUNCHER=ccache']"
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: "release-package"
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
18 changes: 9 additions & 9 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,21 @@ jobs:
max-size: 2G
- name: Build & Collect Coverage
run: |
cmake --preset Coverage -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build --preset Coverage
GTEST_OUTPUT="xml:${PWD}/testresults/" ctest --preset Coverage
cmake --preset coverage -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build --preset coverage
GTEST_OUTPUT="xml:${PWD}/testresults/" ctest --preset coverage
gcovr --sonarqube=coverage.xml --exclude-lines-by-pattern '.*assert\(.*\);|.*really_assert\(.*\);|.*std::abort();' --exclude-unreachable-branches --exclude-throw-branches -j 2 --exclude=.*/generated/.* --exclude=.*/examples/.* --exclude=.*/external/.* --exclude=.*/lwip/.* --exclude=.*/tracing/.* --exclude=.*/test/.*
- name: Build & Run Mutation Tests
run: |
cmake --preset MutationTesting -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build --preset MutationTesting
ctest --preset MutationTesting
cmake --preset mutation-testing -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build --preset mutation-testing
ctest --preset mutation-testing
- name: Convert Results
run: |
{ echo '<testExecutions version="1">'; xsltproc .github/formatters/gtest-to-generic-execution.xslt testresults/*.xml; echo '</testExecutions>'; } | tee execution.xml > /dev/null
jq -s 'reduce .[] as $item ({}; . * $item)' reports/mull/*.json > reports/mull/merged-mutation.json
jq --arg workspace "$GITHUB_WORKSPACE" -f .github/formatters/mutation-report-to-generic-issue.jq reports/mull/merged-mutation.json > mutation-sonar.json
cp build/Coverage/compile_commands.json compile_commands.json
cp build/coverage/compile_commands.json compile_commands.json
- name: Run Analysis
# skip the analysis step for dependabot PRs since dependabot does not have access to secrets
if: ${{ github.actor != 'dependabot[bot]' }}
Expand All @@ -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@04daf014b50eaf774287bf3f0f1869d4b4c4b913 # v2.21.7
Loading

0 comments on commit 228d645

Please sign in to comment.