1
0
mirror of https://github.com/fumiama/base16384-sycl.git synced 2026-06-05 00:32:49 +08:00

feat: add -DBUILD=test & test CI

This commit is contained in:
源文雨
2025-10-13 13:54:20 +08:00
parent f49ef918c4
commit 7bbaa213b4
7 changed files with 71 additions and 10 deletions

47
.github/workflows/test.yml vendored Normal file
View File

@@ -0,0 +1,47 @@
name: test
on: [push, pull_request]
jobs:
test_ubuntu:
name: Run CMake Test on Ubuntu (oneAPI) 🧪
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Build Tools
run: |
# download the key to system keyring
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \
| gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
# add signed entry to apt sources and configure the APT client to use Intel repository:
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
sudo apt-get install -y intel-basekit cmake
- name: Build and Run Tests
run: |
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD=test ..
cmake --build . || ctest --output-on-failure
test_windows:
name: Run CMake Test on Windows (MSVC) 🧪
runs-on: windows-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Build Tools
run: |
Invoke-WebRequest -Uri "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/f5881e61-dcdc-40f1-9bd9-717081ac623c/intel-oneapi-base-toolkit-2025.2.1.46_offline.exe" -OutFile "install.exe"
./install.exe -s -a --silent --eula accept
- name: Build and Run Tests
run: |
mkdir build
cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release ..
cmake --build .; if ($?) { ctest --output-on-failure }