Skip to content

Commit e695321

Browse files
committed
add basic CI for generic tests
1 parent 0a53649 commit e695321

2 files changed

Lines changed: 54 additions & 3 deletions

File tree

.github/workflows/basic.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Basic
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
7+
pull_request:
8+
branches: [ "main" ]
9+
10+
env:
11+
CARGO_TERM_COLOR: always
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Check if oneAPI is already installed
21+
id: check-oneapi
22+
run: |
23+
if [ -f /opt/intel/oneapi/setvars.sh ]; then
24+
echo "installed=true" >> $GITHUB_OUTPUT
25+
else
26+
echo "installed=false" >> $GITHUB_OUTPUT
27+
fi
28+
29+
- name: Setup oneAPI
30+
if: steps.check-oneapi.outputs.installed != 'true'
31+
run: |
32+
# download and install oneAPI
33+
wget --no-verbose https://registrationcenter-download.intel.com/akdlm/IRC_NAS/33cb2a22-ddf1-4aa9-8d68-1f5a118acaf2/intel-oneapi-toolkit-2026.1.0.192_offline.sh
34+
sudo sh ./intel-oneapi-toolkit-2026.1.0.192_offline.sh -a --silent --cli --eula accept
35+
36+
- name: Configure oneAPI environment
37+
run: |
38+
source /opt/intel/oneapi/setvars.sh
39+
# copy envs to github
40+
printenv | grep -E '^(PATH|LD_LIBRARY_PATH|LIBRARY_PATH|CPATH|C_INCLUDE_PATH|CPLUS_INCLUDE_PATH)=' >> $GITHUB_ENV
41+
icx --version
42+
sycl-ls --verbose
43+
44+
- name: Build
45+
run: cargo build --verbose
46+
47+
- name: Run tests
48+
run: cargo test --verbose

oneapi-rs-sys/build.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn main() {
4444
.compile("oneapi-shim");
4545

4646
println!("cargo::rustc-link-lib=sycl");
47-
println!("cargo::rustc-link-lib=ze_loader");
47+
// println!("cargo::rustc-link-lib=ze_loader");
4848
println!("cargo::rustc-link-lib=intlc");
4949

5050
for source in cpp_sources {
@@ -66,7 +66,7 @@ fn get_compiler_path() -> Result<PathBuf, Error> {
6666
if let Ok(path) = std::env::var("CMPLR_ROOT") {
6767
let path = PathBuf::from(path).join("bin/icpx");
6868
if path.exists() {
69-
return Ok(path)
69+
return Ok(path);
7070
}
7171
}
7272
if let Ok(path) = which("icpx") {
@@ -79,5 +79,8 @@ fn get_compiler_path() -> Result<PathBuf, Error> {
7979
return Ok(path);
8080
}
8181

82-
Err(Error::new(std::io::ErrorKind::NotFound, "No DPC++ compiler found"))
82+
Err(Error::new(
83+
std::io::ErrorKind::NotFound,
84+
"No DPC++ compiler found",
85+
))
8386
}

0 commit comments

Comments
 (0)