Skip to content

WIP: simpler CI

WIP: simpler CI #18

name: Build and Test the project
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
submodules: 'recursive'
- name: Cache build directories
uses: actions/cache@v6
with:
path: |
${{github.workspace}}/build
${{github.workspace}}/lib/build
key: ${{ runner.os }}-build-cache-${{ github.sha }}
restore-keys: ${{ runner.os }}-build-cache-
- name: Install system dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y libwayland-dev libxkbcommon-dev xorg-dev
- name: Build vendored dependencies
if: runner.os == 'Linux'
run: make -Clib
- name: Configure CMake
if: runner.os == 'Windows'
run: >
cmake -B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_BUILD_TESTS=1
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install
-S ${{ github.workspace }}
- name: Build (Linux)
if: runner.os == 'Linux'
run: make MODE=release
- name: Build (Windows)
if: runner.os == 'Windows'
run: cmake --build ${{github.workspace}}/build --config Release
- name: Test (Linux)
if: runner.os == 'Linux'
run: make tests
- name: Test (Windows)
if: runner.os == 'Windows'
run: ${{github.workspace}}/build/Release/tests.exe
- name: Install (Linux)
if: runner.os == 'Linux'
run: make install
- name: Install (Windows)
if: runner.os == 'Windows'
run: cmake --install ${{github.workspace}}/build
# ERROR: Invalid workflow file You have an error in your yaml syntax on line 64 (this line)
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: PathTracingRenderer
path: ${{github.workspace}}/install