From aac38a7deb10ab4fcff7938c7b2439bb653268f5 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 21 Mar 2024 23:01:21 +0100 Subject: [PATCH] Update CI. Co-authored-by: Tom Atkinson --- .github/workflows/build.yml | 82 +++++++++++++++++++ .github/workflows/linux.yml | 50 ++++++++--- .github/workflows/macos.yml | 40 --------- .github/workflows/msvc.yml | 76 ----------------- cmake/server.cmake | 4 - public/common/TracySocket.cpp | 3 + update/CMakeLists.txt | 4 - update/src/OfflineSymbolResolverDbgHelper.cpp | 2 + 8 files changed, 124 insertions(+), 137 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/macos.yml delete mode 100644 .github/workflows/msvc.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..7bf42b45 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,82 @@ +name: build + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + strategy: + matrix: + os: [ windows-latest, macos-latest ] + + runs-on: ${{ matrix.os }} + continue-on-error: true + steps: + - uses: actions/checkout@v4 + - if: startsWith(matrix.os, 'windows') + uses: microsoft/setup-msbuild@v2 + - if: startsWith(matrix.os, 'windows') + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - if: startsWith(matrix.os, 'windows') + run: pip install meson ninja + - if: startsWith(matrix.os, 'macos') + name: Install macos dependencies + run: brew install pkg-config glfw meson + - name: Profiler GUI + run: | + cmake -B profiler/build -S profiler + cmake --build profiler/build --config Release --parallel + - name: Update utility + run: | + cmake -B update/build -S update + cmake --build update/build --config Release --parallel + - name: Capture utility + run: | + cmake -B capture/build -S capture + cmake --build capture/build --config Release --parallel + - name: Csvexport utility + run: | + cmake -B csvexport/build -S csvexport + cmake --build csvexport/build --config Release --parallel + - name: Import-chrome utility + run: | + cmake -B import-chrome/build -S import-chrome + cmake --build import-chrome/build --config Release --parallel + - name: Import-fuchsia utility + run: | + cmake -B import-fuchsia/build -S import-fuchsia + cmake --build import-fuchsia/build --config Release --parallel + - if: ${{ !startsWith(matrix.os, 'windows') }} + name: Library + run: meson setup -Dprefix=$GITHUB_WORKSPACE/bin/lib build && meson compile -C build && meson install -C build + - if: ${{ !startsWith(matrix.os, 'windows') }} + name: Find Artifacts + id: find_artifacts + run: | + mkdir -p bin + cp profiler/build/tracy-profiler bin + cp update/build/tracy-update bin + cp capture/build/tracy-capture bin + cp csvexport/build/tracy-csvexport bin + cp import-chrome/build/tracy-import-chrome bin + cp import-fuchsia/build/tracy-import-fuchsia bin + - if: startsWith(matrix.os, 'windows') + name: Find Artifacts + id: find_artifacts_windows + run: | + mkdir bin + copy profiler\build\Release\tracy-profiler.exe bin + copy update\build\Release\tracy-update.exe bin + copy capture\build\Release\tracy-capture.exe bin + copy csvexport\build\Release\tracy-csvexport.exe bin + copy import-chrome\build\Release\tracy-import-chrome.exe bin + copy import-fuchsia\build\Release\tracy-import-fuchsia.exe bin + - uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.os }} + path: bin \ No newline at end of file diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 04f8d41e..447ae2a0 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -8,29 +8,38 @@ on: jobs: build: - - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest container: archlinux:base-devel steps: - uses: actions/checkout@v4 - - name: Install linux libraries - run: pacman -Syu --noconfirm && pacman -S --noconfirm --needed freetype2 capstone tbb debuginfod wayland dbus libxkbcommon libglvnd meson + - name: Install dependencies + run: pacman -Syu --noconfirm && pacman -S --noconfirm --needed freetype2 capstone tbb debuginfod wayland dbus libxkbcommon libglvnd meson cmake git wayland-protocols - name: Profiler GUI - run: make -j`nproc` -C profiler/build/unix debug release + run: | + cmake -B profiler/build -S profiler + cmake --build profiler/build --config Release --parallel - name: Update utility - run: make -j`nproc` -C update/build/unix debug release + run: | + cmake -B update/build -S update + cmake --build update/build --config Release --parallel - name: Capture utility - run: make -j`nproc` -C capture/build/unix debug release + run: | + cmake -B capture/build -S capture + cmake --build capture/build --config Release --parallel - name: Csvexport utility - run: make -j`nproc` -C csvexport/build/unix debug release + run: | + cmake -B csvexport/build -S csvexport + cmake --build csvexport/build --config Release --parallel - name: Import-chrome utility - run: make -j`nproc` -C import-chrome/build/unix debug release + run: | + cmake -B import-chrome/build -S import-chrome + cmake --build import-chrome/build --config Release --parallel - name: Import-fuchsia utility - run: make -j`nproc` -C import-fuchsia/build/unix debug release + run: | + cmake -B import-fuchsia/build -S import-fuchsia + cmake --build import-fuchsia/build --config Release --parallel - name: Library - run: make -j`nproc` -C library/unix debug release - - name: Library (meson) - run: meson setup -Dprefix=$PWD/install build && meson compile -C build && meson install -C build + run: meson setup -Dprefix=$GITHUB_WORKSPACE/bin/lib build && meson compile -C build && meson install -C build - name: Test application run: | make -j`nproc` -C test @@ -39,3 +48,18 @@ jobs: make -j`nproc` -C test clean make -j`nproc` -C test TRACYFLAGS="-DTRACY_DELAYED_INIT -DTRACY_MANUAL_LIFETIME" make -C test -B ../public/TracyClient.o DEFINES='-DTRACY_DEMANGLE' + - name: Find Artifacts + id: find_artifacts + run: | + mkdir -p bin + cp profiler/build/tracy-profiler bin + cp update/build/tracy-update bin + cp capture/build/tracy-capture bin + cp csvexport/build/tracy-csvexport bin + cp import-chrome/build/tracy-import-chrome bin + cp import-fuchsia/build/tracy-import-fuchsia bin + strip bin/tracy-* + - uses: actions/upload-artifact@v4 + with: + name: arch-linux + path: bin diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml deleted file mode 100644 index 98f095c7..00000000 --- a/.github/workflows/macos.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: macos - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: macOS-latest - steps: - - uses: actions/checkout@v4 - - name: Install macos libraries - run: brew install capstone tbb pkg-config glfw meson - - name: Profiler GUI - run: make -j`nproc` -C profiler/build/unix debug release - - name: Update utility - run: make -j`nproc` -C update/build/unix debug release - - name: Capture utility - run: make -j`nproc` -C capture/build/unix debug release - - name: Csvexport utility - run: make -j`nproc` -C csvexport/build/unix debug release - - name: Import-chrome utility - run: make -j`nproc` -C import-chrome/build/unix debug release - - name: Import-fuchsia utility - run: make -j`nproc` -C import-fuchsia/build/unix debug release - - name: Library - run: make -j`nproc` -C library/unix debug release - - name: Library (meson) - run: meson setup -Dprefix=$PWD/install build && meson compile -C build && meson install -C build - - name: Test application - run: | - make -j`nproc` -C test - make -j`nproc` -C test clean - make -j`nproc` -C test TRACYFLAGS=-DTRACY_ON_DEMAND - make -j`nproc` -C test clean - make -j`nproc` -C test TRACYFLAGS="-DTRACY_DELAYED_INIT -DTRACY_MANUAL_LIFETIME" - make -C test -B ../public/TracyClient.o DEFINES='-DTRACY_DEMANGLE' diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml deleted file mode 100644 index f20abe73..00000000 --- a/.github/workflows/msvc.yml +++ /dev/null @@ -1,76 +0,0 @@ -name: MSVC - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build-with-vcpkg-integration: - - runs-on: windows-2022 - - steps: - - uses: actions/checkout@v4 - - uses: microsoft/setup-msbuild@v2 - - name: Integrate vcpkg - run: vcpkg integrate install - - name: Profiler GUI Debug - run: msbuild .\profiler\build\win32\Tracy.vcxproj /property:Configuration=Debug /property:Platform=x64 - - name: Profiler GUI Release - run: msbuild .\profiler\build\win32\Tracy.vcxproj /property:Configuration=Release /property:Platform=x64 - - name: Update utility Debug - run: msbuild .\update\build\win32\update.vcxproj /property:Configuration=Debug /property:Platform=x64 - - name: Update utility Release - run: msbuild .\update\build\win32\update.vcxproj /property:Configuration=Release /property:Platform=x64 - - name: Capture utility Debug - run: msbuild .\capture\build\win32\capture.vcxproj /property:Configuration=Debug /property:Platform=x64 - - name: Capture utility Release - run: msbuild .\capture\build\win32\capture.vcxproj /property:Configuration=Release /property:Platform=x64 - - name: Csvexport utility Debug - run: msbuild .\csvexport\build\win32\csvexport.vcxproj /property:Configuration=Debug /property:Platform=x64 - - name: Csvexport utility Release - run: msbuild .\csvexport\build\win32\csvexport.vcxproj /property:Configuration=Release /property:Platform=x64 - - name: Import-chrome utility Debug - run: msbuild .\import-chrome\build\win32\import-chrome.vcxproj /property:Configuration=Debug /property:Platform=x64 - - name: Import-chrome utility Release - run: msbuild .\import-chrome\build\win32\import-chrome.vcxproj /property:Configuration=Release /property:Platform=x64 - - name: Import-fuchsia utility Debug - run: msbuild .\import-fuchsia\build\win32\import-fuchsia.vcxproj /property:Configuration=Debug /property:Platform=x64 - - name: Import-fuchsia utility Release - run: msbuild .\import-fuchsia\build\win32\import-fuchsia.vcxproj /property:Configuration=Release /property:Platform=x64 - - name: Library - run: msbuild .\library\win32\TracyProfiler.vcxproj /property:Configuration=Release /property:Platform=x64 - - name: Package binaries - run: | - mkdir bin - mkdir bin\dev - copy profiler\build\win32\x64\Release\Tracy.exe bin - copy update\build\win32\x64\Release\update.exe bin - copy capture\build\win32\x64\Release\capture.exe bin - copy import-chrome\build\win32\x64\Release\import-chrome.exe bin - copy csvexport\build\win32\x64\Release\csvexport.exe bin - copy library\win32\x64\Release\TracyProfiler.dll bin\dev - copy library\win32\x64\Release\TracyProfiler.lib bin\dev - 7z a Tracy.7z bin - - uses: actions/upload-artifact@v4 - with: - path: Tracy.7z - - build-without-vcpkg-integration: - - runs-on: windows-2022 - - env: - VCPKG_ROOT: '' - - steps: - - uses: actions/checkout@v4 - - uses: microsoft/setup-msbuild@v2 - - name: Install vcpkg dependencies - run: vcpkg/install_vcpkg_dependencies.bat - - name: Profiler GUI Release - run: msbuild .\profiler\build\win32\Tracy.vcxproj /property:Configuration=Release /property:Platform=x64 - - name: Capture utility Release - run: msbuild .\capture\build\win32\capture.vcxproj /property:Configuration=Release /property:Platform=x64 diff --git a/cmake/server.cmake b/cmake/server.cmake index 6bb0557d..02f6e24d 100644 --- a/cmake/server.cmake +++ b/cmake/server.cmake @@ -36,7 +36,3 @@ endif() if(UNIX AND NOT APPLE AND NOT EMSCRIPTEN) target_link_libraries(TracyServer PRIVATE TracyTbb) endif() - -if(WIN32) - target_link_libraries(TracyServer PRIVATE ws2_32) -endif() diff --git a/public/common/TracySocket.cpp b/public/common/TracySocket.cpp index 25967898..bdba3619 100644 --- a/public/common/TracySocket.cpp +++ b/public/common/TracySocket.cpp @@ -21,6 +21,9 @@ # pragma warning(disable:4267) # endif # define poll WSAPoll +# ifdef _MSC_VER +# pragma comment(lib, "ws2_32.lib") +# endif #else # include # include diff --git a/update/CMakeLists.txt b/update/CMakeLists.txt index 16aa97a2..679de976 100644 --- a/update/CMakeLists.txt +++ b/update/CMakeLists.txt @@ -26,7 +26,3 @@ set(PROGRAM_FILES add_executable(${PROJECT_NAME} ${PROGRAM_FILES} ${COMMON_FILES} ${SERVER_FILES}) target_link_libraries(${PROJECT_NAME} PRIVATE TracyServer TracyGetOpt) - -if(WIN32) - target_link_libraries(${PROJECT_NAME} PRIVATE dbghelp) -endif() diff --git a/update/src/OfflineSymbolResolverDbgHelper.cpp b/update/src/OfflineSymbolResolverDbgHelper.cpp index 20ed2f5e..d454feb5 100644 --- a/update/src/OfflineSymbolResolverDbgHelper.cpp +++ b/update/src/OfflineSymbolResolverDbgHelper.cpp @@ -16,6 +16,8 @@ #include "OfflineSymbolResolver.h" +#pragma comment(lib, "dbghelp.lib") + class SymbolResolver { public: