Skip to content

Commit

Permalink
Use github actions for CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
syby119 committed Feb 18, 2023
1 parent 03f7871 commit c3c991a
Showing 1 changed file with 97 additions and 0 deletions.
97 changes: 97 additions & 0 deletions .github/workflows/build.yml
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

0 comments on commit c3c991a

Please sign in to comment.