-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [ "main", "web" ] | ||
pull_request: | ||
branches: [ "main", "web" ] | ||
workflow_dispatch: | ||
|
||
env: | ||
BUILD_TYPE: Release | ||
|
||
jobs: | ||
build-linux: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt update | ||
sudo apt install libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev | ||
sudo apt install libgl-dev | ||
- name: Configure CMake | ||
run: cmake -Bbuild . -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | ||
|
||
- name: Build | ||
run: cmake --build build --config ${{env.BUILD_TYPE}} --parallel | ||
|
||
build-mac: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Config CMake | ||
run: cmake -Bbuild . -G Xcode -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | ||
|
||
- name: Build | ||
run: cmake --build build --config ${{env.BUILD_TYPE}} --parallel | ||
|
||
build-windows-vs: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Configure CMake with Visual Studio | ||
run: cmake -Bbuild . -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | ||
|
||
- name: Build with Visual Studio | ||
run: cmake --build build --config ${{env.BUILD_TYPE}} --parallel | ||
|
||
build-windows-mingw: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Configure CMake | ||
run: cmake -Bbuild . -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | ||
|
||
- name: Build | ||
run: cmake --build build --config ${{env.BUILD_TYPE}} | ||
|
||
build-web: | ||
if: ${{ github.ref == 'refs/heads/web' }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install and activate emsdk | ||
run: | | ||
git clone --depth=1 https://github.com/emscripten-core/emsdk.git | ||
cd emsdk | ||
./emsdk install latest | ||
./emsdk activate latest | ||
source ./emsdk_env.sh | ||
echo "$PATH" >> $GITHUB_PATH | ||
cd .. | ||
- name: Build | ||
run: | | ||
python3 build_webassembly.py |