diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..3bad6e06 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,116 @@ +name: Build + +on: + push: + branches: [main] + paths: + - '**/*.cpp' + - '**/*.hpp' + - '**/*.h' + - '**/CMakeLists.txt' + - '**/*.cmake' + - '.github/workflows/build.yml' + pull_request: + paths: + - '**/*.cpp' + - '**/*.hpp' + - '**/*.h' + - '**/CMakeLists.txt' + - '**/*.cmake' + - '.github/workflows/build.yml' + workflow_dispatch: + +concurrency: + group: ${{ github.event_name == 'pull_request' && format('build-pr-{0}', github.head_ref) || 'build-main' }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + +jobs: + linux: + name: Linux build + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v5 + + - name: Install system dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + build-essential cmake ninja-build \ + libsndfile1-dev \ + libgl1-mesa-dev libfuse2 \ + libxkbcommon-dev '^libxcb.*-dev' libx11-xcb-dev \ + libglu1-mesa-dev libxrender-dev libxi-dev libxkbfile-dev + + - name: Install Qt 6.8 + uses: jurplel/install-qt-action@v4 + with: + version: "6.8.0" + host: linux + target: desktop + arch: linux_gcc_64 + modules: "" + cache: true + + - name: Configure + run: | + cmake -S . -B build -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_PREFIX_PATH="${Qt6_DIR}" + + - name: Build + run: cmake --build build --parallel + + windows: + name: Windows build + if: false + runs-on: windows-2022 + defaults: + run: + shell: pwsh + steps: + - uses: actions/checkout@v5 + + - name: Configure MSVC environment + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64 + + - name: Install Qt 6.8 + uses: jurplel/install-qt-action@v4 + with: + version: "6.8.0" + host: windows + target: desktop + arch: win64_msvc2022_64 + modules: "" + cache: true + + - name: Configure + run: | + cmake -S . -B build -G Ninja ` + -DCMAKE_BUILD_TYPE=Release ` + -DCMAKE_PREFIX_PATH="$env:Qt6_DIR" + + - name: Build + run: cmake --build build --parallel + + macos: + name: macOS build + runs-on: macos-14 + steps: + - uses: actions/checkout@v5 + + - name: Install dependencies + run: | + brew update + brew install cmake ninja libsndfile qt@6 + brew link --force qt@6 + + - name: Configure + run: | + cmake -S . -B build -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_PREFIX_PATH="$(brew --prefix qt@6)" + + - name: Build + run: cmake --build build --parallel