From 6b0ddee85ccda05e42f73909eb1e6c283e2d5c7a Mon Sep 17 00:00:00 2001 From: derselbst Date: Fri, 1 Jan 2021 21:22:27 +0100 Subject: [PATCH] Update CI scripts from master --- .appveyor-vcpkg.yml | 135 +++++++++++++++++++++++++------------------ .azure-pipelines.yml | 24 +++++++- .travis.yml | 58 +++++++++++++++---- 3 files changed, 148 insertions(+), 69 deletions(-) diff --git a/.appveyor-vcpkg.yml b/.appveyor-vcpkg.yml index cb581e9c..029ae71e 100644 --- a/.appveyor-vcpkg.yml +++ b/.appveyor-vcpkg.yml @@ -1,58 +1,81 @@ -image: - - Visual Studio 2019 -build: - parallel: true - verbosity: detailed +variables: + toolset: 'v142' + generator: 'Visual Studio 16 2019' + VCPKG_DIR: 'C:\vcpkg' -configuration: - - Release - -environment: - # update the vcpkg cache even if build fails - APPVEYOR_SAVE_CACHE_ON_ERROR: true - - matrix: - - platform: ARM - - platform: x86 - - platform: x64 - -cache: - - c:\Tools\vcpkg\installed - -init: - - set TARGET_PLATFORM= - - if "%platform%"=="x86" ( set TARGET_PLATFORM=Win32) - - if "%platform%"=="x64" ( set TARGET_PLATFORM=x64) - - if "%platform%"=="ARM" ( set TARGET_PLATFORM=ARM) - - echo %TARGET_PLATFORM% - - echo %APPVEYOR_BUILD_WORKER_IMAGE% - - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2019" ( set "generator=Visual Studio 16 2019" && set "toolset=v142" ) - - echo %generator% - - echo %toolset% - -install: -# make sure the latest version of git is installed - - choco upgrade git ninja -y - - ninja --version - - cmake --version -# manually update vcpkg - - cd "C:\Tools\vcpkg" - - git pull - - .\bootstrap-vcpkg.bat - - cd %appveyor_build_folder% - - vcpkg install glib:%platform%-windows || type C:\Tools\vcpkg\buildtrees\libffi\config-arm-windows-out.log - -build_script: - - mkdir build - - cd build - - cmake -Werror=dev -G "%generator%" -A %TARGET_PLATFORM% -T "%toolset%" -Denable-pkgconfig=0 -DCMAKE_TOOLCHAIN_FILE=c:/Tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 .. - - cmake --build . --config Release # build libfluidsynth and fluidsynth exec - - if not "%platform%"=="ARM" ( cmake --build . --config Release --target check ) # build and exec unittests, unless when cross-compiling - -after_build: - - 7z a fluidsynth-vcpkg-%platform%.zip %APPVEYOR_BUILD_FOLDER%\build\src\Release\* - -artifacts: - - path: build/fluidsynth-vcpkg-%platform%.zip - name: FluidSynth +jobs: +- job: vcpkg + workspace: + clean: all + strategy: + matrix: + ARM: + platform: 'ARM' + cmake_platform: 'ARM' + configuration: 'Release' + x86: + platform: 'x86' + cmake_platform: 'Win32' + configuration: 'Release' + x64: + platform: 'x64' + cmake_platform: 'x64' + configuration: 'Release' + pool: + vmImage: 'windows-2019' + steps: + - script: | + @ECHO ON + echo $(generator) + echo $(toolset) + choco upgrade ninja -y + ninja --version + cmake --version + REM manually update vcpkg + REM cd "$(VCPKG_DIR)" || exit -1 + REM git pull || exit -1 + REM .\bootstrap-vcpkg.bat || exit -1 + REM cd $(Build.SourcesDirectory) + where vcpkg.exe + vcpkg install --only-downloads glib:$(platform)-windows + displayName: 'Prerequisites' + - task: Cache@2 + displayName: "Cache vcpkg's packages" + inputs: + key: $(VCPKG_DIR)\downloads\glib* | "$(platform)" + path: "$(VCPKG_DIR)" + cacheHitVar: CACHE_RESTORED + - script: | + @ECHO ON + vcpkg install glib:$(platform)-windows + displayName: 'vcpkg build glib' + condition: ne(variables.CACHE_RESTORED, 'true') + - script: | + @ECHO ON + mkdir build + cd build + cmake -Werror=dev -G "$(generator)" -A "$(cmake_platform)" -T "$(toolset)" -Denable-pkgconfig=0 -DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX=$(Build.ArtifactStagingDirectory) -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 .. || exit -1 + REM build libfluidsynth and fluidsynth exec + cmake --build . --config $(configuration) || exit -1 + displayName: 'Compile fluidsynth' + - script: | + @ECHO ON + REM build and exec unittests, unless when cross-compiling + if not "%platform%"=="ARM" ( cmake --build build --config $(configuration) --target check ) + displayName: 'Execute Unittests' + - script: | + @ECHO ON + cd build + cmake --build . --config $(configuration) --target install || exit -1 + REM del $(Build.ArtifactStagingDirectory)\bin\concrt*.dll + REM del $(Build.ArtifactStagingDirectory)\bin\vcruntime*.dll + REM del $(Build.ArtifactStagingDirectory)\bin\msvcp*.dll + REM del $(Build.ArtifactStagingDirectory)\lib\instpatch*.lib + REM del $(Build.ArtifactStagingDirectory)\lib\pkgconfig\libinstpatch*.pc + REM rd $(Build.ArtifactStagingDirectory)\include\libinstpatch-2 /s /q + displayName: 'Copy Artifacts' + - task: PublishBuildArtifacts@1 + inputs: + pathtoPublish: $(Build.ArtifactStagingDirectory) + artifactName: fluidsynth-vcpkg-$(platform) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 3c91e92d..ce1ee2d1 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -49,6 +49,7 @@ jobs: mv -f * .. cd .. rmdir $(Build.ArtifactStagingDirectory)\libinstpatch-$(platform)\ + DEL /F C:\Strawberry\perl\bin\pkg-config.bat displayName: 'Prerequisites' - script: | @ECHO ON @@ -122,6 +123,7 @@ jobs: REM need to fix the naming of libsndfile otherwise the linker won't find it mv lib\libsndfile-1.lib lib\sndfile.lib || exit -1 mv lib\libsndfile-1.def lib\sndfile.def || exit -1 + DEL /F C:\Strawberry\perl\bin\pkg-config.bat displayName: 'Prerequisites' - script: | @ECHO ON @@ -146,12 +148,14 @@ jobs: gtk-bundle: $(gtk-bundle-x86) libsndfile-url: $(libsndfile-url-x86) mingw-url: $(mingw-url-x86) + artifact-prefix: "fluidsynth-mingw" x64: CMAKE_FLAGS: platform: x64 gtk-bundle: $(gtk-bundle-x64) libsndfile-url: $(libsndfile-url-x64) mingw-url: $(mingw-url-x64) + artifact-prefix: "fluidsynth-mingw" pool: vmImage: 'vs2017-win2016' steps: @@ -180,6 +184,7 @@ jobs: mv lib\libsndfile-1.def lib\sndfile.def || exit -1 cd mingw*\ && cp -rf * .. && cd .. && rm -rf mingw* || exit -1 cd $(Build.ArtifactStagingDirectory)\libinstpatch-$(platform) && cp -rf * d:\deps\ && mv -f * .. && cd .. && rmdir $(Build.ArtifactStagingDirectory)\libinstpatch-$(platform)\ || exit -1 + DEL /F C:\Strawberry\perl\bin\pkg-config.bat displayName: 'Prerequisites' - script: | @ECHO ON @@ -189,7 +194,7 @@ jobs: set PATH=%PATH:C:\Program Files\Git\usr\bin;=% pkg-config --list-all mkdir build && cd build || exit -1 - cmake -Werror=dev -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=$(Build.ArtifactStagingDirectory) $(CMAKE_FLAGS) -Denable-readline=0 -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 .. || exit -1 + cmake -Werror=dev -G "MinGW Makefiles" -DCMAKE_INSTALL_PREFIX=$(Build.ArtifactStagingDirectory) $(CMAKE_FLAGS) -Denable-readline=0 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 .. || exit -1 mingw32-make.exe all || exit -1 displayName: 'Compile fluidsynth' - script: | @@ -201,3 +206,20 @@ jobs: cd build || exit -1 mingw32-make.exe check || exit -1 displayName: 'Execute Unittests' + continueOnError: 'true' + - script: | + @ECHO ON + cd build + mingw32-make.exe install || exit -1 + xcopy test $(Build.ArtifactStagingDirectory)\bin /s + del $(Build.ArtifactStagingDirectory)\bin\concrt*.dll + del $(Build.ArtifactStagingDirectory)\bin\vcruntime*.dll + del $(Build.ArtifactStagingDirectory)\bin\msvcp*.dll + del $(Build.ArtifactStagingDirectory)\lib\instpatch*.lib + del $(Build.ArtifactStagingDirectory)\lib\pkgconfig\libinstpatch*.pc + rd $(Build.ArtifactStagingDirectory)\include\libinstpatch-2 /s /q + displayName: 'Copy Artifacts' + - task: PublishBuildArtifacts@1 + inputs: + pathtoPublish: $(Build.ArtifactStagingDirectory) + artifactName: $(artifact-prefix)-$(platform) diff --git a/.travis.yml b/.travis.yml index 6b5de751..28ef5b06 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,18 @@ language: c sudo: false os: linux -dist: bionic +dist: focal +git: + depth: false # disable shallow fetch, history is needed by SonarQube addons: apt: update: true sources: - ubuntu-toolchain-r-test - - llvm-toolchain-bionic-7 - - llvm-toolchain-bionic-8 - - llvm-toolchain-bionic-9 + - llvm-toolchain-focal-7 + - llvm-toolchain-focal-8 + - llvm-toolchain-focal-9 + - llvm-toolchain-focal-10 packages: - cmake-data - cmake @@ -36,33 +39,61 @@ env: matrix: include: + - addons: + sonarcloud: + organization: "fluidsynth" + env: + - BW="build-wrapper-linux-x86-64 --out-dir bw-output" + - SONARSC="sonar-scanner -Dsonar.cfamily.build-wrapper-output=build/bw-output" + - arch: arm64 env: - - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7 && sudo apt-get install gcc-7" + - CC="gcc-7" + - CXX="g++-7" + - MATRIX_EVAL="sudo apt-get install gcc-7 g++-7" + + - dist: trusty + env: + - CMAKE_FLAGS="" - env: - - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8 && sudo apt-get install gcc-8" + - CC="gcc-8" + - CXX="g++-8" + - MATRIX_EVAL="sudo apt-get install gcc-8 g++-8" - CMAKE_FLAGS="-Denable-debug=1 -DCMAKE_C_FLAGS_DEBUG=-fuse-ld=gold" - env: - - MATRIX_EVAL="CC=clang-7 && CXX=clang++-7 && sudo apt-get install clang-7" + - CC="clang-7" + - CXX="clang++-7" + - MATRIX_EVAL="sudo apt-get install clang-7" - env: - - MATRIX_EVAL="CC=clang-8 && CXX=clang++-8 && sudo rm -f /usr/local/clang-7.0.0/bin/clang-tidy && sudo ln -s /usr/bin/clang-tidy-8 /usr/bin/clang-tidy && sudo apt-get install clang-8 clang-tidy-8" + - CC="clang-8" + - CXX="clang++-8" + - MATRIX_EVAL="sudo rm -f /usr/local/clang-7.0.0/bin/clang-tidy && sudo ln -s /usr/bin/clang-tidy-8 /usr/bin/clang-tidy && sudo apt-get install clang-8 clang-tidy-8" - CMAKE_FLAGS="-Denable-profiling=1 -DCMAKE_C_FLAGS_DEBUG=-fuse-ld=gold" - env: - - MATRIX_EVAL="CC=clang-9 && CXX=clang++-9 && sudo apt-get install clang-9" + - CC="clang-9" + - CXX="clang++-9" + - MATRIX_EVAL="sudo apt-get install clang-9" + + - env: + - CC="clang-10" + - CXX="clang++-10" + - MATRIX_EVAL="sudo apt-get install clang-10" - os: linux-ppc64le env: - CMAKE_FLAGS="" before_install: - - eval "${MATRIX_EVAL}" - which clang-tidy || true - ls -la `which clang-tidy` || true - echo $PATH + - echo $MATRIX_EVAL + - eval "${MATRIX_EVAL}" + - echo $SONARSC before_script: - mkdir $HOME/fluidsynth_install/ @@ -70,6 +101,9 @@ before_script: script: - cmake -Werror=dev -DCMAKE_INSTALL_PREFIX=$HOME/fluidsynth_install ${CMAKE_FLAGS} -Denable-portaudio=1 -Denable-ladspa=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_VERBOSE_MAKEFILE=1 -DNO_GUI=1 .. - - make -j4 + - ${BW} make -j4 + - ls -la - make check - - make install # install only on linux, as CMAKE_INSTALL_PREFIX is ignored for frameworks on macosx and I cant tell whether that's correct or a bug. + - make install + - cd .. + - ${SONARSC}