@@ -9,19 +9,58 @@ concurrency:
99 group : ${{ github.workflow }}-${{ github.ref }}
1010 cancel-in-progress : true
1111jobs :
12- build :
12+ build-unix :
1313 runs-on : ${{ matrix.os }}
1414 strategy :
1515 matrix :
1616 type : [Debug, Release]
17- os :
18- [
19- ubuntu-22.04,
20- ubuntu-22.04-arm,
21- windows-latest,
22- macos-15-intel,
23- macos-15,
24- ]
17+ os : [ubuntu-22.04, ubuntu-22.04-arm, macos-15-intel, macos-15]
18+ steps :
19+ - name : Checkout
20+ uses : actions/checkout@v4
21+ with :
22+ submodules : recursive
23+
24+ - name : Install Nix
25+ uses : cachix/install-nix-action@v30
26+
27+ - name : Install devenv
28+ run : nix profile install nixpkgs#devenv
29+
30+ - name : Cache devenv
31+ uses : cachix/cachix-action@v15
32+ with :
33+ name : devenv
34+
35+ - name : Build with devenv
36+ run : |
37+ devenv shell cmake -- -B build -S . -G Ninja \
38+ -DCMAKE_BUILD_TYPE=${{ matrix.type }} \
39+ -DPLUME_BUILD_EXAMPLES=ON
40+ devenv shell cmake -- --build build --target plume
41+ devenv shell cmake -- --build build --target plume_triangle
42+
43+ - name : Upload Linux Build
44+ if : runner.os == 'Linux'
45+ uses : actions/upload-artifact@v4
46+ with :
47+ name : plume-linux-${{ matrix.type }}-${{ matrix.os }}
48+ path : |
49+ build/bin/plume_triangle
50+
51+ - name : Upload macOS Build
52+ if : runner.os == 'macOS'
53+ uses : actions/upload-artifact@v4
54+ with :
55+ name : plume-macos-${{ matrix.type }}-${{ matrix.os }}
56+ path : |
57+ build/bin/plume_triangle
58+
59+ build-windows :
60+ runs-on : windows-latest
61+ strategy :
62+ matrix :
63+ type : [Debug, Release]
2564 steps :
2665 - name : Checkout
2766 uses : actions/checkout@v4
@@ -31,90 +70,35 @@ jobs:
3170 - name : ccache
3271 uses : hendrikmuhs/ccache-action@v1.2
3372 with :
34- key : ${{ runner.os }} -plume-ccache-${{ matrix.type }}
73+ key : windows -plume-ccache-${{ matrix.type }}
3574
3675 - name : Install Windows Dependencies
37- if : runner.os == 'Windows'
3876 run : |
3977 choco install ninja
4078 vcpkg install sdl2 --triplet x64-windows-static
4179
4280 Remove-Item -Path "C:\ProgramData\Chocolatey\bin\ccache.exe" -Force -ErrorAction SilentlyContinue
4381 "C:\vcpkg\installed\x64-windows-static\bin" >> $env:GITHUB_PATH
4482
45- - name : Install Linux Dependencies
46- if : runner.os == 'Linux'
47- run : |
48- sudo apt-get update
49- sudo apt-get install -y ninja-build libsdl2-dev libgtk-3-dev
50-
51- # Install SDL2
52- echo ::group::install SDL2
53- wget https://www.libsdl.org/release/SDL2-2.26.1.tar.gz
54- tar -xzf SDL2-2.26.1.tar.gz
55- cd SDL2-2.26.1
56- ./configure
57- make -j 10
58- sudo make install
59- sudo cp -av /usr/local/lib/libSDL* /lib/x86_64-linux-gnu/
60- echo ::endgroup::
61-
62- # Enable ccache
63- export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
64-
65- - name : Install macOS Dependencies
66- if : runner.os == 'macOS'
67- run : |
68- brew install ninja sdl2
69-
7083 - name : Configure Developer Command Prompt
71- if : runner.os == 'Windows'
7284 uses : ilammy/msvc-dev-cmd@v1
7385
74- - name : Build Plume (Unix)
75- if : runner.os != 'Windows'
76- run : |-
77- # enable ccache
78- export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"
79-
80- cmake -DCMAKE_BUILD_TYPE=${{ matrix.type }} -DPLUME_BUILD_EXAMPLES=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_MAKE_PROGRAM=ninja -G Ninja -S . -B cmake-build
81- cmake --build cmake-build --config ${{ matrix.type }} --target plume
82- cmake --build cmake-build --config ${{ matrix.type }} --target plume_triangle
83-
84- - name : Build Plume (Windows)
85- if : runner.os == 'Windows'
86- run : |-
86+ - name : Build Plume
87+ run : |
8788 # enable ccache
8889 set $env:PATH="$env:USERPROFILE/.cargo/bin;$env:PATH"
8990 $cpuCores = (Get-CimInstance -ClassName Win32_Processor).NumberOfLogicalProcessors
9091
9192 # remove LLVM from PATH so it doesn't overshadow the one provided by VS
9293 $env:PATH = ($env:PATH -split ';' | Where-Object { $_ -ne 'C:\Program Files\LLVM\bin' }) -join ';'
9394
94- 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 cmake- build
95- cmake --build cmake- build --config ${{ matrix.type }} --target plume -j $cpuCores
96- cmake --build cmake- build --config ${{ matrix.type }} --target plume_triangle -j $cpuCores
95+ 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
96+ cmake --build build --config ${{ matrix.type }} --target plume -j $cpuCores
97+ cmake --build build --config ${{ matrix.type }} --target plume_triangle -j $cpuCores
9798
9899 - name : Upload Windows Build
99- if : runner.os == 'Windows'
100100 uses : actions/upload-artifact@v4
101101 with :
102102 name : plume-windows-${{ matrix.type }}
103103 path : |
104- cmake-build/bin/plume_triangle.exe
105-
106- - name : Upload Linux Build
107- if : runner.os == 'Linux'
108- uses : actions/upload-artifact@v4
109- with :
110- name : plume-linux-${{ matrix.type }}-${{ matrix.os }}
111- path : |
112- cmake-build/bin/plume_triangle
113-
114- - name : Upload macOS Build
115- if : runner.os == 'macOS'
116- uses : actions/upload-artifact@v4
117- with :
118- name : plume-macos-${{ matrix.type }}-${{ matrix.os }}
119- path : |
120- cmake-build/bin/plume_triangle
104+ build/bin/plume_triangle.exe
0 commit comments