Skip to content

Commit fe508bc

Browse files
committed
Add support for GitHub Actions
1 parent 9ba66d4 commit fe508bc

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/ci.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
name: ${{ matrix.platform.name }} ${{ matrix.config.name }}
8+
runs-on: ${{ matrix.platform.os }}
9+
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
platform:
14+
- { name: Windows VS2019, os: windows-2019 }
15+
- { name: Windows VS2022, os: windows-2022 }
16+
- { name: Linux GCC, os: ubuntu-latest }
17+
- { name: Linux Clang, os: ubuntu-latest, flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ }
18+
- { name: MacOS XCode, os: macos-latest }
19+
config:
20+
- { name: Shared, flags: -DCMAKESFMLPROJECT_STATIC_LIBS=OFF -DBUILD_SHARED_LIBS=TRUE }
21+
- { name: Static, flags: -DCMAKESFMLPROJECT_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=FALSE }
22+
23+
steps:
24+
- name: Install Linux Dependencies
25+
if: runner.os == 'Linux'
26+
run: sudo apt-get update && sudo apt-get install libxrandr-dev libxcursor-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev
27+
28+
- name: CMake SFML Project - Checkout Code
29+
uses: actions/checkout@v3
30+
31+
- name: SFML - Checkout Code
32+
uses: actions/checkout@v3
33+
with:
34+
fetch-depth: 0
35+
repository: SFML/SFML
36+
ref: 2.6.x
37+
path: SFML
38+
39+
- name: SFML - Configure CMake
40+
shell: bash
41+
run: cmake -S $GITHUB_WORKSPACE/SFML -B $GITHUB_WORKSPACE/SFML/build -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/SFML/install -DCMAKE_VERBOSE_MAKEFILE=ON ${{matrix.platform.flags}} ${{matrix.config.flags}}
42+
43+
- name: SFML - Build
44+
shell: bash
45+
run: cmake --build $GITHUB_WORKSPACE/SFML/build --config Release --target install
46+
47+
- name: CMake SFML Project - Configure CMake
48+
shell: bash
49+
run: cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/install -DCMAKE_VERBOSE_MAKEFILE=ON -DSFML_DIR=$GITHUB_WORKSPACE/SFML/install/lib/cmake/SFML ${{matrix.platform.flags}} ${{matrix.config.flags}}
50+
51+
- name: CMake SFML Project - Build
52+
shell: bash
53+
run: cmake --build $GITHUB_WORKSPACE/build --config Release --target install

0 commit comments

Comments
 (0)