diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..2400c7a8 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,25 @@ +name: Build + +on: + push: + +jobs: + build: + + runs-on: ${{matrix.os-type}} + + strategy: + matrix: + os-type: [windows-2022, macos-13, ubuntu-20.04] + configuration: [Debug, Release, RelWithDebInfo] + fail-fast: false + + steps: + - uses: actions/checkout@v4 + - name: Configure + run: cmake -B ${{github.workspace}}/Build -DCMAKE_BUILD_TYPE=${{matrix.configuration}} + - name: Build + run: cmake --build ${{github.workspace}}/Build --config ${{matrix.configuration}} + - name: Test + working-directory: ${{github.workspace}}/Build + run: ctest -C ${{matrix.configuration}} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 200c5de0..00000000 --- a/.travis.yml +++ /dev/null @@ -1,164 +0,0 @@ -language: cpp - -matrix: - include: - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-7 - env: - - MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" - - PACKAGE_NAME=Linux_gcc7 - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-8 - env: - - MATRIX_EVAL="CC=gcc-8 && CXX=g++-8" - - PACKAGE_NAME=Linux_gcc8 - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-9 - env: - - MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" - - PACKAGE_NAME=Linux_gcc9 - - os: linux - addons: - apt: - sources: - - llvm-toolchain-xenial-7 - packages: - - clang-7 - env: - - MATRIX_EVAL="CC=clang-7 && CXX=clang++-7" - - PACKAGE_NAME=Linux_clang7 - - os: linux - addons: - apt: - sources: - - llvm-toolchain-xenial-8 - packages: - - clang-8 - env: - - MATRIX_EVAL="CC=clang-8 && CXX=clang++-8" - - PACKAGE_NAME=Linux_clang8 - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main' - key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' - packages: - - clang-9 - env: - - MATRIX_EVAL="CC=clang-9 && CXX=clang++-9" - - PACKAGE_NAME=Linux_clang9 - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - - sourceline: 'deb https://apt.llvm.org/xenial/ llvm-toolchain-xenial-10 main' - key_url: 'https://apt.llvm.org/llvm-snapshot.gpg.key' - packages: - - clang-10 - env: - - MATRIX_EVAL="CC=clang-10 && CXX=clang++-10" - - PACKAGE_NAME=Linux_clang10 - - os: osx - osx_image: xcode10.3 - env: - - MATRIX_EVAL="CC=clang && CXX=clang++" - - PACKAGE_NAME=OSX_XCode10_3 - - os: osx - osx_image: xcode11 - env: - - MATRIX_EVAL="CC=clang && CXX=clang++" - - PACKAGE_NAME=OSX_XCode11 - - os: osx - osx_image: xcode11.6 - env: - - MATRIX_EVAL="CC=clang && CXX=clang++" - - PACKAGE_NAME=OSX_XCode11_6 - - os: osx - osx_image: xcode12 - env: - - MATRIX_EVAL="CC=clang && CXX=clang++" - - PACKAGE_NAME=OSX_XCode12 - - os: osx - osx_image: xcode12.2 - env: - - MATRIX_EVAL="CC=clang && CXX=clang++" - - PACKAGE_NAME=OSX_XCode12_2 - - os: osx - osx_image: xcode12u - env: - - MATRIX_EVAL="CC=clang && CXX=clang++" - - PACKAGE_NAME=OSX_XCode12U - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-9 - coverity_scan: - project: - name: "kovacsv/VisualScriptEngine" - notification_email: viktorkovacs@gmail.com - build_command_prepend: >- - cov-configure --compiler g++-9 --comptype g++ --template && - mkdir CovBuild && cd CovBuild && cmake -DCMAKE_BUILD_TYPE=Debug .. - build_command: make - branch_pattern: coverity_scan - env: - - secure: "aUNsXQXL4JZoRpdPkLuOvIzHitW+qu57mgWXL1mwhMSzGD7nMeLKmBChRIdfQm5DWdw+t6qcMgC830Pi6W2plkpgBryK4Rk6gDhlhA7s6lEANdHMTD9hmOcBEz5UWJ0IxRyR6nscEBKrzjku5ct3gOt/B3yCyRsjG5uDsBeggDY28A310ijxjWHS7bGu52ihN/45eCyNXzP3Bq3ogwwWertJDAq2rNkBBnj7ISDQWZ9VMOD6iYSOFWvAXGYM9dW2yJAjHQfdv2I7hEW69LzFZ6WZT4UBoZBSeewoeq81yXVfvnr/y0yqfNHuEHJehjOa3bQFrdKOt2CFIWD/TXpEdnE6ICWIGs8dM1adMkLGpi54UMXXU4FSyDP07xMZhfqKvhjYgbITXSVsGmi+mSVaRMWl9McN3hLI4MKZvx/e6LCyP7QbodHN4VxCGdC79KX0RgSVcJLipGuj/zVtTQ9jqaAkaPa4FnGeY3377QIaDrFxShAVhPOrWcjSqEy0MpqFEI8HBG0WYpEGO3ErqASAwpp/UJ19pbaSzXYjYvZZycTFMOaKIQfm5r+BDD2U7iJD7GFvDOM6ftIsdqbWCOIHwBxfqfmbloKUr7/smu19DUVAdDLDkbfoZwbEjJufyYqQBt+3kocoi6AoiptMpVGwfh5mrXjZ3Ncl+Rv8PRtqxeU=" - - MATRIX_EVAL="CC=gcc-9 && CXX=g++-9" - - PACKAGE_NAME=CoverityScan_gcc9 - -before_install: - - eval "${MATRIX_EVAL}" - -script: - - mkdir Build - - cd Build - - mkdir Debug - - cd Debug - - cmake -DCMAKE_BUILD_TYPE=Debug ../.. - - make - - make test ARGS="-V" - - make install - - cd .. - - cd .. - - python3 CreatePackage.py Build/Debug/DevKit ${PACKAGE_NAME} Debug - - cd Build - - mkdir Release - - cd Release - - cmake -DCMAKE_BUILD_TYPE=Release ../.. - - make - - make test ARGS="-V" - - make install - - cd .. - - cd .. - - python3 CreatePackage.py Build/Release/DevKit ${PACKAGE_NAME} Release - - cd Build - - mkdir RelWithDebInfo - - cd RelWithDebInfo - - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ../.. - - make - - make test ARGS="-V" - - make install - - cd .. - - cd .. - - python3 CreatePackage.py Build/RelWithDebInfo/DevKit ${PACKAGE_NAME} RelWithDebInfo diff --git a/CMakeLists.txt b/CMakeLists.txt index 004ddd87..ec05d7ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ set (VSE_CUSTOM_BUILD_OPTIONS ${VSE_CUSTOM_BUILD_OPTIONS}) function (SetCompilerOptions module) target_compile_options (${module} PUBLIC "$<$:-DDEBUG>") - if (WIN32) + if (MSVC) set (AdditionalWarnings /w44061 /w44062 /w44265 /w44266 /w44355 /w44596 /w44800) target_compile_options (${module} PUBLIC /W4 /WX ${AdditionalWarnings} ${VSE_CUSTOM_BUILD_OPTIONS}) else () @@ -159,14 +159,13 @@ target_include_directories ( ) target_link_libraries (EmbeddingTutorial NodeEngine NodeUIEngine BuiltInNodes) SetCompilerOptions (EmbeddingTutorial) -if (WIN32) +if (MSVC) target_compile_options (EmbeddingTutorial PUBLIC /wd4100) else () target_compile_options (EmbeddingTutorial PUBLIC -Wno-unused-parameter) endif () if (WIN32) - # WindowsAppSupport set (WindowsAppSupportSourcesFolder Sources/WindowsAppSupport) diff --git a/CreatePackage.py b/CreatePackage.py index 4a6646f0..50f47b5d 100644 --- a/CreatePackage.py +++ b/CreatePackage.py @@ -19,7 +19,19 @@ def GetVersionFromCMakeLists (cMakeListsPath): match2 = re.search (r'set \(VSE_VERSION_2 ([0-9]+)\)', content) match3 = re.search (r'set \(VSE_VERSION_3 ([0-9]+)\)', content) return ".".join ([match1.group (1), match2.group (1), match3.group (1)]) - + +def FindPDB (buildDir, moduleName, buildType): + pdbPath = os.path.join (buildDir, moduleName + '.dir', buildType, moduleName + '.pdb') + if os.path.exists (pdbPath): + return pdbPath + pdbPath = os.path.join (buildDir, buildType, moduleName + '.pdb') + if os.path.exists (pdbPath): + return pdbPath + pdbPath = os.path.join (buildDir, buildType, moduleName + 'Debug.pdb') + if os.path.exists (pdbPath): + return pdbPath + return None + def Main (argv): currentDir = os.path.dirname (os.path.abspath (__file__)) os.chdir (currentDir) @@ -55,9 +67,9 @@ def Main (argv): if platform.system () == 'Windows': if buildType in ['Debug', 'RelWithDebInfo']: libPath = os.path.abspath (os.path.join (devKitDir, 'lib')) - for module in ['NodeEngine', 'NodeUIEngine', 'BuiltInNodes', 'WindowsAppSupport']: - pdbPath = os.path.join (buildDir, module + '.dir', buildType, module + '.pdb') - zip.write (pdbPath, os.path.join (os.path.basename (libPath), module + '.pdb')) + for moduleName in ['NodeEngine', 'NodeUIEngine', 'BuiltInNodes', 'WindowsAppSupport']: + pdbPath = FindPDB (buildDir, moduleName, buildType) + zip.write (pdbPath, os.path.join (os.path.basename (libPath), moduleName + '.pdb')) outputPath = os.path.abspath (os.path.join (buildDir, buildType)) for testFile in ['WindowsReferenceApp.exe']: zip.write (os.path.join (outputPath, testFile), os.path.join ('testapp', testFile)) diff --git a/README.md b/README.md index dfce7b72..81796d59 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,7 @@ A visual scripting engine designed for embedding. The engine is written in modern C++ and compiles on several platforms with no external dependencies. Some platform dependent user interface utilities are also provided for Windows and MacOS platforms. -[![Build Status](https://travis-ci.com/kovacsv/VisualScriptEngine.svg?branch=master)](https://travis-ci.com/kovacsv/VisualScriptEngine) -[![Build Status](https://ci.appveyor.com/api/projects/status/c0qxxixyhymfxfdf?svg=true)](https://ci.appveyor.com/project/kovacsv/visualscriptengine) -[![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/kovacsv/VisualScriptEngine.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/kovacsv/VisualScriptEngine/context:cpp) -[![Total alerts](https://img.shields.io/lgtm/alerts/g/kovacsv/VisualScriptEngine.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/kovacsv/VisualScriptEngine/alerts/) -[![codecov](https://codecov.io/gh/kovacsv/VisualScriptEngine/branch/master/graph/badge.svg?token=LAB72UD38J)](https://codecov.io/gh/kovacsv/VisualScriptEngine) +[![Build Status](https://github.com/kovacsv/VisualScriptEngine/actions/workflows/build.yml/badge.svg)](https://github.com/kovacsv/VisualScriptEngine/actions/workflows/build.yml) ## Documentation diff --git a/appveyor.yml b/appveyor.yml index ac83b5ac..25ec52d1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -8,6 +8,7 @@ environment: image: - Visual Studio 2017 - Visual Studio 2019 + - Visual Studio 2022 configuration: - Debug @@ -23,6 +24,7 @@ init: - set cMakeParams= - if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2017" ( set cMakeParams=-G "Visual Studio 15 2017 Win64" ) - if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2019" ( set cMakeParams=-G "Visual Studio 16 2019" -A "x64") + - if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2022" ( set cMakeParams=-G "Visual Studio 17 2022" -A "x64") before_build: - mkdir Build @@ -38,6 +40,7 @@ after_build: - set packageName= - if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2017" (set packageName=Windows_VS2017) - if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2019" (set packageName=Windows_VS2019) + - if "%APPVEYOR_BUILD_WORKER_IMAGE%" == "Visual Studio 2022" (set packageName=Windows_VS2022) - python CreateDevKit.py "MSBuild" %configuration% - python CreatePackage.py Build\DevKit %packageName% %configuration% @@ -49,22 +52,6 @@ test_script: artifacts: - path: Build\Package\* -for: - - - matrix: - only: - - configuration: Debug - image: Visual Studio 2017 - install: - - choco install opencppcoverage codecov - - set PATH=C:\Program Files\OpenCppCoverage;%PATH% - test_script: - - cd Build - - ctest --verbose --build-config %configuration% - - OpenCppCoverage.exe --export_type cobertura:coverage.xml --modules "*.exe" --cover_children --sources=*Sources\NodeEngine --sources=*Sources\NodeUIEngine --sources=*Sources\BuiltInNodes --excluded_sources=*Sources\NodeEngineTest -- ctest --verbose --build-config %configuration% - - codecov -f coverage.xml --root %APPVEYOR_BUILD_FOLDER% - - cd .. - deploy: description: 'News:\n- ...\n\nMigration:\n- ...' provider: GitHub diff --git a/codecov.yml b/codecov.yml deleted file mode 100644 index c31f84a4..00000000 --- a/codecov.yml +++ /dev/null @@ -1,4 +0,0 @@ -coverage: - range: 50..80 - round: down - precision: 0