feat: devenv setup (for discussion) #218
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: validate | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| types: [opened, synchronize] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-unix: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| type: [Debug, Release] | |
| os: [ubuntu-22.04, ubuntu-22.04-arm, macos-15-intel, macos-15] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Install Nix | |
| uses: cachix/install-nix-action@v31 | |
| - name: Install devenv | |
| uses: cachix/cachix-action@v16 | |
| with: | |
| name: devenv | |
| - run: nix profile install nixpkgs#devenv | |
| - name: Build with devenv | |
| shell: devenv shell bash -- -e {0} | |
| run: | | |
| cmake -B build -S . -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=${{ matrix.type }} \ | |
| -DPLUME_BUILD_EXAMPLES=ON | |
| cmake --build build --target plume | |
| cmake --build build --target plume_triangle | |
| cmake --build build --target plume_cube | |
| - name: Upload Linux Build | |
| if: runner.os == 'Linux' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: plume-linux-${{ matrix.type }}-${{ matrix.os }} | |
| path: | | |
| build/bin/plume_triangle | |
| build/bin/plume_cube | |
| - name: Upload macOS Build | |
| if: runner.os == 'macOS' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: plume-macos-${{ matrix.type }}-${{ matrix.os }} | |
| path: | | |
| build/bin/plume_triangle | |
| build/bin/plume_cube | |
| build-windows: | |
| runs-on: windows-latest | |
| strategy: | |
| matrix: | |
| type: [Debug, Release] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: ccache | |
| uses: hendrikmuhs/ccache-action@v1.2 | |
| with: | |
| key: windows-plume-ccache-${{ matrix.type }} | |
| - name: Install Windows Dependencies | |
| run: | | |
| choco install ninja | |
| vcpkg install sdl2 --triplet x64-windows-static | |
| Remove-Item -Path "C:\ProgramData\Chocolatey\bin\ccache.exe" -Force -ErrorAction SilentlyContinue | |
| "C:\vcpkg\installed\x64-windows-static\bin" >> $env:GITHUB_PATH | |
| - name: Configure Developer Command Prompt | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Build Plume | |
| run: | | |
| # enable ccache | |
| set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH" | |
| $cpuCores = (Get-CimInstance -ClassName Win32_Processor).NumberOfLogicalProcessors | |
| # remove LLVM from PATH so it doesn't overshadow the one provided by VS | |
| $env:PATH = ($env:PATH -split ';' | Where-Object { $_ -ne 'C:\Program Files\LLVM\bin' }) -join ';' | |
| cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DPLUME_BUILD_EXAMPLES=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=clang-cl -DCMAKE_C_COMPILER=clang-cl -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B build | |
| cmake --build build --config ${{ matrix.type }} --target plume -j $cpuCores | |
| cmake --build build --config ${{ matrix.type }} --target plume_triangle -j $cpuCores | |
| cmake --build build --config ${{ matrix.type }} --target plume_cube -j $cpuCores | |
| - name: Upload Windows Build | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: plume-windows-${{ matrix.type }} | |
| path: | | |
| build/bin/plume_triangle.exe | |
| build/bin/plume_cube.exe |