Skip to content

updated workflow

updated workflow #37

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