mirror of
https://github.com/wolfpld/tracy.git
synced 2026-08-20 10:09:49 +00:00
Define CMAKE_PARALLEL once per environment (--parallel 2 on GitHub CI, unlimited locally) and use it across every cmake build, so all builds are OOM-protected, not just the profiler GUI.
104 lines
3.7 KiB
YAML
104 lines
3.7 KiB
YAML
name: linux
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
pull_request:
|
|
branches: [ master ]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
group: linux-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
env:
|
|
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm-cache
|
|
|
|
jobs:
|
|
build-linux:
|
|
runs-on: ubuntu-latest
|
|
container: archlinux:base-devel
|
|
steps:
|
|
- name: Install dependencies
|
|
run: pacman -Syu --noconfirm && pacman -S --noconfirm --needed freetype2 debuginfod wayland dbus libxkbcommon libglvnd meson cmake git wayland-protocols nodejs lua clang sdl3_image python-jinja
|
|
- name: Trust git repo
|
|
run: git config --global --add safe.directory '*'
|
|
- uses: actions/checkout@v4
|
|
- name: Cache CPM packages
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ env.CPM_SOURCE_CACHE }}
|
|
key: ${{ runner.os }}-cpm-${{ hashFiles('**/vendor.cmake', '**/CMakeLists.txt') }}
|
|
restore-keys: ${{ runner.os }}-cpm-
|
|
- name: Determine build parallelism
|
|
run: |
|
|
if [ "${ACT:-}" != "true" ] && [ "${FORGEJO_ACTIONS:-}" != "true" ]; then
|
|
echo "CMAKE_PARALLEL=--parallel 2" >> "$GITHUB_ENV"
|
|
else
|
|
echo "CMAKE_PARALLEL=--parallel" >> "$GITHUB_ENV"
|
|
fi
|
|
- name: Dyna example / clang
|
|
run: |
|
|
CC=clang CXX=clang++ cmake -B examples/dyna/build-clang -S examples/dyna -DCMAKE_BUILD_TYPE=Release
|
|
cmake --build examples/dyna/build-clang $CMAKE_PARALLEL
|
|
- name: Dyna example / gcc
|
|
run: |
|
|
CC=gcc CXX=g++ cmake -B examples/dyna/build-gcc -S examples/dyna -DCMAKE_BUILD_TYPE=Release
|
|
cmake --build examples/dyna/build-gcc $CMAKE_PARALLEL
|
|
- name: Profiler GUI
|
|
run: |
|
|
cmake -B profiler/build -S profiler -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
|
|
cmake --build profiler/build $CMAKE_PARALLEL
|
|
- name: Update utility
|
|
run: |
|
|
cmake -B update/build -S update -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
|
|
cmake --build update/build $CMAKE_PARALLEL
|
|
- name: Capture utility
|
|
run: |
|
|
cmake -B capture/build -S capture -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
|
|
cmake --build capture/build $CMAKE_PARALLEL
|
|
- name: Csvexport utility
|
|
run: |
|
|
cmake -B csvexport/build -S csvexport -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
|
|
cmake --build csvexport/build $CMAKE_PARALLEL
|
|
- name: Import utilities
|
|
run: |
|
|
cmake -B import/build -S import -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
|
|
cmake --build import/build $CMAKE_PARALLEL
|
|
- name: Merge utility
|
|
run: |
|
|
cmake -B merge/build -S merge -DCMAKE_BUILD_TYPE=Release -DGIT_REV=${{ github.sha }}
|
|
cmake --build merge/build $CMAKE_PARALLEL
|
|
- name: Library (cmake)
|
|
run: |
|
|
cmake -B build -DCMAKE_BUILD_TYPE=Release -DTRACY_ENABLE=ON
|
|
cmake --build build $CMAKE_PARALLEL
|
|
env:
|
|
CMAKE_INSTALL_PREFIX: ${{ github.workspace }}/bin
|
|
- name: Library (meson)
|
|
run: |
|
|
meson setup -Dprefix=$GITHUB_WORKSPACE/bin/lib -Dtracy_enable=true build-meson
|
|
meson compile -C build-meson
|
|
- name: Test application
|
|
uses: ./.github/actions/test-tracy
|
|
- 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 capture/build/tracy-capture-daemon bin
|
|
cp csvexport/build/tracy-csvexport bin
|
|
cp import/build/tracy-import-chrome bin
|
|
cp import/build/tracy-import-fuchsia bin
|
|
cp merge/build/tracy-merge bin
|
|
strip bin/tracy-*
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: arch-linux
|
|
path: bin
|