Skip to content

Linux

Linux #2

name: CUDA CMake Build (Linux)
on:
pull_request:
branches:
- linux
- main
jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
build_type: [Debug, Release]
steps:
- uses: actions/checkout@v4
- name: Install OpenGL deps
run: |
sudo apt-get update
sudo apt-get install -y \
libgl1-mesa-dev \
libglu1-mesa-dev \
libx11-dev \
libxrandr-dev \
libxinerama-dev \
libxcursor-dev \
libxi-dev
- name: Install CUDA Toolkit
run: |
sudo apt-get update
sudo apt-get install -y wget gnupg
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
sudo apt-get install -y cuda-toolkit-12-4
- name: Install OpenGL & GLFW deps
run: |
sudo apt-get update
sudo apt-get install -y \
libglfw3-dev \
libglew-dev \
libglm-dev \
libx11-dev \
libxrandr-dev \
libxinerama-dev \
libxcursor-dev \
libxi-dev
- name: Set CUDA env
run: |
echo "/usr/local/cuda/bin" >> $GITHUB_PATH
echo "CUDA_HOME=/usr/local/cuda" >> $GITHUB_ENV
- name: Configure CMake
run: |
cmake -S . -B build-${{ matrix.build_type }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
- name: Build
run: |
cmake --build build-${{ matrix.build_type }} --config ${{ matrix.build_type }}
- name: Run tests
run: |
cd build-${{ matrix.build_type }}
ctest --output-on-failure