Skip to content

Commit

Permalink
ci: add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
molingyu committed Sep 4, 2024
1 parent 0cbf7f3 commit 127ef1c
Showing 1 changed file with 86 additions and 0 deletions.
86 changes: 86 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: CI Build

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

env:
BUILD_TYPE: Debug

jobs:
build-ubuntu-gcc:
name: ubuntu-gcc
runs-on: ubuntu-latest
timeout-minutes: 4
steps:
- uses: actions/checkout@v4

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}/build
run: ./bin/test

build-ubuntu-clang:
name: ubuntu-clang
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_CXX_COMPILER=clang++-14 -DCMAKE_C_COMPILER=clang

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}/build
run: ./bin/test

build-macos:
name: macos
runs-on: macos-latest

steps:
- uses: actions/checkout@v4

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}/build
run: ./bin/test

build-windows:
name: windows
runs-on: windows-latest
steps:

- uses: actions/checkout@v4

- name: Setup MSVC dev command prompt
uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: x64

- name: Configure CMake
# enkiTS is failing ASAN on windows
# run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBOX2D_SAMPLES=OFF -DBOX2D_SANITIZE=ON -DBUILD_SHARED_LIBS=OFF
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}/build
run: ./bin/${{env.BUILD_TYPE}}/test

0 comments on commit 127ef1c

Please sign in to comment.