ci: fail Ubuntu CI if there are compiler warnings (#304)
This commit is contained in:
parent
683883b08a
commit
b32fd63c83
5
.github/workflows/build-ubuntu-20.04.yml
vendored
5
.github/workflows/build-ubuntu-20.04.yml
vendored
@ -27,12 +27,11 @@ jobs:
|
||||
sudo apt-get update --fix-missing
|
||||
sudo apt install -y ${{ matrix.compiler.pkg }}-${{ matrix.compiler.version }}
|
||||
- name: Compile tests
|
||||
working-directory: build
|
||||
env:
|
||||
CXX: ${{ matrix.compiler.exe }}-${{ matrix.compiler.version }}
|
||||
run: |
|
||||
cmake ${{ matrix.mode }} -DBUILD_TESTING=ON -Dlibuv_buildtests=OFF ..
|
||||
make -j2
|
||||
cmake ${{ matrix.mode }} --preset ci-ubuntu
|
||||
cmake --build build/ --parallel 2
|
||||
- name: Run tests
|
||||
working-directory: build
|
||||
env:
|
||||
|
||||
5
.github/workflows/build-ubuntu-latest.yml
vendored
5
.github/workflows/build-ubuntu-latest.yml
vendored
@ -26,12 +26,11 @@ jobs:
|
||||
sudo apt-get update --fix-missing
|
||||
sudo apt install -y ${{ matrix.compiler.pkg }}-${{ matrix.compiler.version }}
|
||||
- name: Compile tests
|
||||
working-directory: build
|
||||
env:
|
||||
CXX: ${{ matrix.compiler.exe }}-${{ matrix.compiler.version }}
|
||||
run: |
|
||||
cmake ${{ matrix.mode }} -DBUILD_TESTING=ON -Dlibuv_buildtests=OFF ..
|
||||
make -j2
|
||||
cmake ${{ matrix.mode }} --preset ci-ubuntu
|
||||
cmake --build build/ --parallel 2
|
||||
- name: Run tests
|
||||
working-directory: build
|
||||
env:
|
||||
|
||||
59
CMakePresets.json
Normal file
59
CMakePresets.json
Normal file
@ -0,0 +1,59 @@
|
||||
{
|
||||
"version": 2,
|
||||
"cmakeMinimumRequired": {
|
||||
"major": 3,
|
||||
"minor": 13,
|
||||
"patch": 0
|
||||
},
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "cmake-pedantic",
|
||||
"description": "Enables all CMake warnings.`",
|
||||
"hidden": true,
|
||||
"warnings": {
|
||||
"dev": true,
|
||||
"deprecated": true,
|
||||
"uninitialized": true,
|
||||
"unusedCli": true,
|
||||
"systemVars": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "dev-mode",
|
||||
"hidden": true,
|
||||
"description": "Common (non-OS specific) mode for development",
|
||||
"inherits": "cmake-pedantic",
|
||||
"cacheVariables": {
|
||||
"BUILD_TESTING": true,
|
||||
"libuv_buildtests": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "flags-linux",
|
||||
"hidden": true,
|
||||
"description": "Compiler flags for GNU and Clang compilers. When compiling in DEBUG mode, all warnings will be converted into errors.",
|
||||
"cacheVariables": {
|
||||
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wcast-qual -Wformat=2 -Wundef -Wshadow -Wcast-align -Wunused -Wnull-dereference -Wimplicit-fallthrough -Woverloaded-virtual -Wnon-virtual-dtor -Wold-style-cast",
|
||||
"CMAKE_CXX_FLAGS_DEBUG": "-Werror"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ci-linux",
|
||||
"generator": "Unix Makefiles",
|
||||
"hidden": true,
|
||||
"inherits": ["flags-linux"],
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ci-build",
|
||||
"binaryDir": "${sourceDir}/build",
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
"name": "ci-ubuntu",
|
||||
"inherits": ["ci-build", "ci-linux", "dev-mode"]
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user