mirror of
https://github.com/johndoe6345789/MetalOS.git
synced 2026-04-24 13:45:02 +00:00
57 lines
1.2 KiB
YAML
57 lines
1.2 KiB
YAML
name: Unit Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [ main, copilot/* ]
|
|
pull_request:
|
|
branches: [ main ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
unit-tests:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
set -e # Exit on any error
|
|
|
|
sudo apt-get update
|
|
sudo apt-get install -y build-essential clang cmake python3 python3-pip
|
|
|
|
# Install Conan
|
|
pip3 install conan
|
|
|
|
# Configure Conan
|
|
conan profile detect --force
|
|
|
|
- name: Install Conan dependencies
|
|
run: |
|
|
conan install . --build=missing
|
|
|
|
- name: Configure CMake
|
|
run: |
|
|
mkdir -p build
|
|
cd build
|
|
CC=clang CXX=clang++ cmake .. -DCMAKE_TOOLCHAIN_FILE=../build/Release/generators/conan_toolchain.cmake
|
|
|
|
- name: Build unit tests
|
|
run: |
|
|
cd build
|
|
cmake --build .
|
|
|
|
- name: Run unit tests
|
|
run: |
|
|
cd build
|
|
ctest --output-on-failure
|
|
|
|
- name: Test summary
|
|
if: always()
|
|
run: |
|
|
echo "Unit test execution completed"
|