Reorganize directory structure and other clean-ups #774
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Linux | |
on: | |
push: | |
paths: | |
- '.github/workflows/linux.yml' | |
- 'CMakeLists.txt' | |
- 'src/**' | |
- 'test/**' | |
- 'modules/**' | |
- '3rdparty/**' | |
pull_request: | |
paths: | |
- '.github/workflows/linux.yml' | |
- 'CMakeLists.txt' | |
- 'src/**' | |
- 'test/**' | |
- 'modules/**' | |
- '3rdparty/**' | |
release: | |
types: published | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
compiler: [gcc, clang] | |
config: [Release, Debug] | |
image: [ubuntu-22.04] | |
runs-on: ${{ matrix.image }} | |
env: | |
CC: ${{ matrix.compiler == 'gcc' && 'gcc' || 'clang' }} | |
CXX: ${{ matrix.compiler == 'gcc' && 'g++' || 'clang++' }} | |
CMAKE_C_COMPILER_LAUNCHER: ccache | |
CMAKE_CXX_COMPILER_LAUNCHER: ccache | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
submodules: recursive | |
- uses: hendrikmuhs/ccache-action@v1 | |
with: | |
key: linux-${{ matrix.image }}-${{ matrix.compiler }}-${{ matrix.config }} | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
# TODO: Better to only install dependencies of these packages instead, except ninja | |
sudo apt install -y libglfw3-dev libopenal-dev libglvnd-core-dev libsdl2-dev ninja-build | |
- name: Configure | |
run: | | |
cmake -G Ninja -B build -DCMAKE_BUILD_TYPE=${{ matrix.config }} -DCMAKE_LINK_WHAT_YOU_USE=TRUE | |
- name: Compile Dependencies | |
run: | | |
cmake --build build --parallel --config ${{ matrix.config }} --target compile-osp-magnum-deps compile-test-deps | |
- name: Compile OSP-Magnum | |
run: | | |
cmake --build build --parallel --config ${{ matrix.config }} --target osp-magnum | |
- name: Compile Unit Tests | |
run: | | |
cmake --build build --parallel --config ${{ matrix.config }} --target compile-tests | |
# TODO: Why doesn't the "test" target execute tests? | |
- name: Run Unit Tests | |
run: | | |
ctest --schedule-random --progress --output-on-failure --parallel --no-tests error --build-config ${{ matrix.config }} --test-dir build | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: OSP-linux-${{ matrix.image}}-${{ matrix.config }}-${{ matrix.compiler }} | |
path: build/${{ matrix.config }} |