-
-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (44 loc) · 1.76 KB
/
cmake-single-platform.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Build and Test Umgebung
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Dependencies (apt-get and Homebrew)
run: |
sudo apt-get update
sudo apt-get install -y build-essential procps curl file git
# Install Homebrew if not present
if ! command -v brew &> /dev/null; then
echo "Homebrew is not installed. Installing..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> ~/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
else
echo "Homebrew already installed."
fi
# Set up Homebrew environment in current shell session
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
- name: Install Project Dependencies via Brewfile
run: |
# Ensure Homebrew environment is still available in this step
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew bundle --file=Brewfile
- name: Set PKG_CONFIG_PATH for Homebrew Libraries
run: |
# Set the PKG_CONFIG_PATH so pkg-config can find the libraries
echo "export PKG_CONFIG_PATH=$(brew --prefix)/lib/pkgconfig:$(brew --prefix sdl2)/lib/pkgconfig:$(brew --prefix glew)/lib/pkgconfig:$(brew --prefix ftgl)/lib/pkgconfig" >> $GITHUB_ENV
- name: Configure CMake
run: cmake -B build -DBUILD_TESTING=ON -DSET_COMPILER_FLAGS=ON
- name: Build Project
run: cmake --build build
- name: Run Tests
run: ctest --test-dir build