Skip to content

Commit f81db4b

Browse files
authored
Create cmake.yml
1 parent 1bd6ce0 commit f81db4b

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/cmake.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CMake
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
env:
10+
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
11+
BUILD_TYPE: Release
12+
13+
jobs:
14+
build:
15+
# The CMake configure and build commands are platform agnostic and should work equally
16+
# well on Windows or Mac. You can convert this to a matrix build if you need
17+
# cross-platform coverage.
18+
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
24+
- name: Install dependencies
25+
run: sudo apt-get install libglfw3-dev libglew-dev libglm-dev
26+
27+
- name: Configure CMake
28+
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
29+
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
30+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
31+
32+
- name: Build
33+
# Build your program with the given configuration
34+
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
35+
36+
- name: Test
37+
working-directory: ${{github.workspace}}/build
38+
# Execute tests defined by the CMake configuration.
39+
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
40+
run: ctest -C ${{env.BUILD_TYPE}}
41+

0 commit comments

Comments
 (0)