Skip to content

Commit bb23339

Browse files
committed
Add workflow to test n-1 static loader from main with dynamic loader from PR
Signed-off-by: Vishnu Khanth <vishnu.khanth.b@intel.com>
1 parent a93cb08 commit bb23339

1 file changed

Lines changed: 110 additions & 0 deletions

File tree

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
on:
2+
push:
3+
branches: [ master,release_branch* ]
4+
pull_request:
5+
branches: [ master,release_branch* ]
6+
workflow_dispatch:
7+
8+
permissions: read-all
9+
10+
jobs:
11+
# Linux job: Build static loader from main, dynamic loader from PR, test static loader with PR dynamic loader
12+
build-linux:
13+
if: github.repository_owner == 'oneapi-src'
14+
runs-on: ubuntu-latest
15+
steps:
16+
# Checkout PR branch (dynamic loader source)
17+
- uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
path: pr
21+
22+
# Checkout main branch for static loader source
23+
- name: Checkout main branch for static loader
24+
uses: actions/checkout@v3
25+
with:
26+
ref: main
27+
fetch-depth: 0
28+
path: main
29+
30+
# Build static loader from main branch
31+
- name: Build Static Loader from main
32+
run: |
33+
cd main
34+
mkdir build
35+
cd build
36+
cmake \
37+
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
38+
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
39+
-D CMAKE_BUILD_TYPE=Release \
40+
-D BUILD_L0_LOADER_TESTS=1 \
41+
-D BUILD_STATIC=1 \
42+
..
43+
make -j$(nproc)
44+
45+
# Build dynamic loader from PR branch
46+
- name: Build Dynamic Loader from PR
47+
run: |
48+
cd pr
49+
mkdir dynamic_build
50+
cd dynamic_build
51+
cmake \
52+
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
53+
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
54+
-D CMAKE_BUILD_TYPE=Release \
55+
-D BUILD_STATIC=0 \
56+
..
57+
make -j$(nproc)
58+
59+
# Run CTest in static loader's build directory, using PR dynamic loader via ZEL_LIBRARY_PATH
60+
- name: Run CTest with PR dynamic loader and main static loader
61+
env:
62+
ZEL_LIBRARY_PATH: '${{ github.workspace }}/pr/dynamic_build/lib'
63+
working-directory: main/build
64+
run: |
65+
ls $ZEL_LIBRARY_PATH
66+
ctest -V
67+
68+
# Windows job: Build static loader from main, dynamic loader from PR, test static loader with PR dynamic loader
69+
build-windows:
70+
if: github.repository_owner == 'oneapi-src'
71+
runs-on: windows-latest
72+
steps:
73+
# Checkout PR branch (dynamic loader source)
74+
- uses: actions/checkout@v3
75+
with:
76+
fetch-depth: 0
77+
path: pr
78+
79+
# Checkout main branch for static loader source
80+
- name: Checkout main branch for static loader
81+
uses: actions/checkout@v3
82+
with:
83+
ref: main
84+
fetch-depth: 0
85+
path: main
86+
87+
# Build static loader from main branch
88+
- name: Build Static Loader from main
89+
run: |
90+
cd main
91+
mkdir build
92+
cd build
93+
cmake -D BUILD_L0_LOADER_TESTS=1 -D BUILD_STATIC=1 ..
94+
cmake --build . --config Release
95+
96+
# Build dynamic loader from PR branch
97+
- name: Build Dynamic Loader from PR
98+
run: |
99+
cd pr
100+
mkdir dynamic_build
101+
cd dynamic_build
102+
cmake -D BUILD_L0_LOADER_TESTS=0 -D BUILD_STATIC=0 ..
103+
cmake --build . --config Release
104+
105+
# Run CTest in static loader's build directory, using PR dynamic loader via ZEL_LIBRARY_PATH
106+
- name: Run CTest with PR dynamic loader and main static loader
107+
env:
108+
ZEL_LIBRARY_PATH: '${{ github.workspace }}\\pr\\dynamic_build\\bin\\Release'
109+
working-directory: main/build
110+
run: ctest -C Release -V

0 commit comments

Comments
 (0)