Browse Source

Add action to compile on windows and linux

Jorrit Rouwe 4 years ago
parent
commit
614e0004ac
2 changed files with 58 additions and 0 deletions
  1. 56 0
      .github/workflows/build.yml
  2. 2 0
      README.md

+ 56 - 0
.github/workflows/build.yml

@@ -0,0 +1,56 @@
+name: Build
+
+on:
+  push:
+    branches: [ master ]
+    paths-ignore:
+      - 'Docs/**'
+      - '**.md'
+      - '**.txt'
+  pull_request:
+    branches: [ master ]
+    paths-ignore:
+      - 'Docs/**'
+      - '**.md'
+      - '**.txt'
+
+jobs:
+  linux:
+    runs-on: ubuntu-latest
+    name: Linux
+    strategy:
+        fail-fast: false
+        matrix:
+            build_type: [Debug, Release, Distribution, ReleaseASAN, ReleaseUBSAN]
+
+    steps:
+    - name: Checkout Code
+      uses: actions/checkout@v2
+    - name: Configure CMake
+      run: cmake -B ${{github.workspace}}/Build/Linux_${{matrix.build_type}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} Build
+    - name: Build
+      run: cmake --build ${{github.workspace}}/Build/Linux_${{matrix.build_type}} --config ${{matrix.build_type}}
+    - name: Test
+      working-directory: ${{github.workspace}}/Build/Linux_${{matrix.build_type}}
+      run: ctest --output-on-failure
+
+  msvc_cl:
+    runs-on: windows-latest
+    name: Visual Studio CL
+    strategy:
+        fail-fast: false
+        matrix:
+            build_type: [Debug, Release, Distribution]
+
+    steps:
+    - name: Checkout Code
+      uses: actions/checkout@v2
+    - name: Add msbuild to PATH
+      uses: microsoft/[email protected]
+    - name: Configure CMake
+      run: cmake -B ${{github.workspace}}/Build/VS2019_CL -G "Visual Studio 16 2019" -A x64 Build
+    - name: Build
+      run: msbuild Build\VS2019_CL\JoltPhysics.sln /property:Configuration=${{matrix.build_type}}
+    - name: Test
+      working-directory: ${{github.workspace}}/Build/VS2019_CL/${{matrix.build_type}}
+      run: ./UnitTests.exe

+ 2 - 0
README.md

@@ -1,3 +1,5 @@
+[![Build Status](https://github.com/jrouwe/JoltPhysics/actions/workflows/build.yml/badge.svg)](https://github.com/jrouwe/JoltPhysics/actions/)
+
 # Jolt Physics Library
 
 A multi core friendly rigid body physics and collision detection library suitable for games and VR applications.