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 maintenance #181

Merged
merged 14 commits into from
Nov 29, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ option(BUILD_SNAPSHOT "build snapshot test" OFF)
include(CMakeDependentOption)
CMAKE_DEPENDENT_OPTION(TEST_DUMP_SNAPSHOT "build test to dump the expected output instead of verifing it" OFF
"BUILD_SNAPSHOT" OFF)
option(WITH_SDL2_STATIC "linking STATIC LIB with SDL2 STATIC" OFF)
### Disabling SDL2-static as it requires to use the x64-windows-static
### and therefore all the libs must be static.
#option(WITH_SDL2_STATIC "linking STATIC LIB with SDL2 STATIC" OFF)
option(HAVE_PRECISE_TIMER "if SDL2 timers are precise" ON)

add_subdirectory ("sdl2-vga-terminal")
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ there are 5 pipelines, 1 for each OS and one dedicated to "Analysis", plus 1 for
| Debug | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| Release | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| BUILD_SHARED_LIBS | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| WITH_SDL2_STATIC | :heavy_check_mark: | only | only |
| ~~WITH_SDL2_STATIC~~ | :heavy_check_mark: | only | only |
| BUILD_TESTING | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| BUILD_EXAMPLES | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
| BUILD_SNAPSHOT | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
Expand All @@ -59,6 +59,14 @@ there are 5 pipelines, 1 for each OS and one dedicated to "Analysis", plus 1 for
- code coverage available only with LLVM and GCC in `cmake`, on CI working only on macos
- `TEST_DUMP_SNAPSHOT` is "forbidden" to test for the build as an helper flag only.

### Linux Note

It is required to install `sdl[x11]` along side `sdl` pacakge otherwise linking error.

### SDL2-static switch
It has been disabled as it has been moved to a different triplet `x64-windows-static` and just makes it annoying to test for it as it requires to have also a VCPKG_TARGET_TRIPLET to be changed and so it should be used as a different job itself rather than a switch, even though the switch in CMAKE is required to link the proper `SDL2::SDL2` or `SDL2::SDL2-static`.

At the moment the `WITH_SDL2_STATIC` option in CMAKE has been disabled.

## Synopsis

Expand Down
8 changes: 5 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ for:
TRIPLET: $PLATFORM-osx
HAVE_PRECISE_TIMER: OFF
cache:
#- $WS/vcpkg
##- $WS/vcpkg
- $WS/vcpkg/installed
init:
- sh: if [ $PLATFORM = "x86" ]; then exit 1; fi
Expand Down Expand Up @@ -82,8 +82,10 @@ before_build:
- cmd: cd C:\tools\vcpkg
- sh : cd $WS/vcpkg
- git pull
- cmd: IF NOT EXIST vcpkg.exe .\bootstrap-vcpkg.bat
- sh : test -f vcpkg || ./bootstrap-vcpkg.sh
#- cmd: IF NOT EXIST vcpkg.exe .\bootstrap-vcpkg.bat
#- sh : test -f vcpkg || ./bootstrap-vcpkg.sh
- cmd: .\bootstrap-vcpkg.bat
- sh : ./bootstrap-vcpkg.sh
- cmd: vcpkg install sdl2 sdl2-image gtest --triplet %PLATFORM%-windows
- sh : ./vcpkg install sdl2 sdl2-image gtest --triplet $TRIPLET
- cmd: cd %APPVEYOR_BUILD_FOLDER%
Expand Down
1 change: 1 addition & 0 deletions azure-pipelines/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ stages:
parameters:
vcpkg_key_cache: $(CACHE_VCPKG_KEY)
triplet: x64-linux
packages: 'sdl2 sdl2[x11] sdl2-image gtest'

- stage: CI
jobs:
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines/matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ stages:
jobName: "linux"
vmImageName: ${{ variables.linux_image }}
triplet: x64-linux
sdl2_static: ['ON']
#sdl2_static: ['ON']
enable_code_coverage: ['OFF']
- stage: matrix_windows
displayName: Matrix Windows
Expand All @@ -93,4 +93,4 @@ stages:
jobName: "macos"
vmImageName: ${{ variables.mac_image }}
triplet: x64-osx
sdl2_static: ['ON']
#sdl2_static: ['ON']
4 changes: 2 additions & 2 deletions azure-pipelines/templates/matrix-job.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
parameters:
configuration: ['Debug', 'Release']
sdl2_static: ['ON', 'OFF']
#sdl2_static: ['ON', 'OFF']
build_testing: ['ON', 'OFF']
build_shared_libs: ['ON', 'OFF']
build_examples: ['ON', 'OFF']
Expand All @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
${{ each configuration in parameters.configuration }}:
${{ each sdl2_static in parameters.sdl2_static}}:
#${{ each sdl2_static in parameters.sdl2_static}}:
${{ each build_testing in parameters.build_testing }}:
${{ each build_shared_libs in parameters.build_shared_libs }}:
${{ each build_examples in parameters.build_examples }}:
Expand Down
15 changes: 11 additions & 4 deletions azure-pipelines/templates/sonarcloud-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,21 +133,28 @@ jobs:

- bash: |
echo '#!/bin/bash' > g.sh
echo 'exec /usr/local/Cellar/llvm/10.0.0_3/bin/llvm-cov gcov "$@"' >> g.sh
echo 'exec /usr/local/Cellar/llvm/13.0.0_1/bin/llvm-cov gcov "$@"' >> g.sh

chmod +x g.sh
cat g.sh
pwd
displayName: llvm-cov gcov wrapper
workingDirectory: build
condition: ne(variables['Agent.OS'], 'Windows_NT')


#- bash: env
# displayName: DEBUG display environment
#- bash: sudo find / -name llvm-cov 2> /dev/null
# displayName: llvm-cov DEBUG
# displayName: DEBUG find llvm-cov
# condition: ne(variables['Agent.OS'], 'Windows_NT')

- bash: |
pwd
ls
echo $OSTYPE
test $OSTYPE = "darwin19" && brew install lcov || apt-get install -y lcov
./g.sh -f -b -u $(find . -name *.gcda)
lcov --directory . --base-directory . --gcov-tool ./g.sh --capture -o cov.info
lcov --directory . --base-directory . --gcov-tool /Users/runner/work/1/s/build/g.sh --capture -o cov.info
lcov --remove cov.info '/Applications/*' --output-file coverage.info
lcov --list coverage.info
#gcovr -r ../ --filter ../sdl2-vga-terminal/src -o sonarcube.xml --sonarqube
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines/variables/build_switches.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
variables:
SDL2_STATIC: ON
#SDL2_STATIC: OFF
BUILD_TESTING: ON
BUILD_SHARED_LIBS: ON
BUILD_EXAMPLES: ON
Expand Down
4 changes: 2 additions & 2 deletions azure-pipelines/variables/global.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
variables:
CACHE_VCPKG_KEY: v4-1 | vcpkg-root
CACHE_VCPKG_KEY: v0-4-1 | vcpkg-root
VCPKG_CMAKE: "$(Build.SourcesDirectory)/vcpkg/scripts/buildsystems/vcpkg.cmake"
CMAKE_ARGS: -DWITH_SDL2_STATIC=$(SDL2_STATIC) -DBUILD_TESTING=$(BUILD_TESTING) -DBUILD_SHARED_LIBS=$(BUILD_SHARED_LIBS) -DBUILD_EXAMPLES=$(BUILD_EXAMPLES) -DBUILD_SNAPSHOT=$(BUILD_SNAPSHOT) -DENABLE_CODE_COVERAGE=$(ENABLE_CODE_COVERAGE) -DHAVE_PRECISE_TIMER=$(HAVE_PRECISE_TIMER)
CMAKE_ARGS: -DBUILD_TESTING=$(BUILD_TESTING) -DBUILD_SHARED_LIBS=$(BUILD_SHARED_LIBS) -DBUILD_EXAMPLES=$(BUILD_EXAMPLES) -DBUILD_SNAPSHOT=$(BUILD_SNAPSHOT) -DENABLE_CODE_COVERAGE=$(ENABLE_CODE_COVERAGE) -DHAVE_PRECISE_TIMER=$(HAVE_PRECISE_TIMER)
CMAKE_IGNORE_PATH_WIN: "C:/MinGW/bin;C:/Strawberry/c/bin;C:/Program Files (x86)/LLVM/bin;C:/ProgramData/chocolatey/bin"