-
Notifications
You must be signed in to change notification settings - Fork 133
140 lines (128 loc) · 5.16 KB
/
Copy pathbuild-quick-static-n-1.yml
File metadata and controls
140 lines (128 loc) · 5.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
on:
push:
branches: [ master,release_branch* ]
pull_request:
branches: [ master,release_branch* ]
workflow_dispatch:
permissions: read-all
jobs:
# Linux job: Build static loader from master, dynamic loader from PR, test static loader with PR dynamic loader
build-linux:
if: github.repository_owner == 'oneapi-src'
runs-on: ubuntu-latest
steps:
# Use ccache-action for ccache setup and caching
- uses: actions/checkout@v3
with:
fetch-depth: 0
path: pr
- uses: hendrikmuhs/ccache-action@v1
# Checkout master branch for static loader source
- name: Checkout master branch for static loader
uses: actions/checkout@v3
with:
ref: master
fetch-depth: 0
path: master
# Build static loader from master branch
- name: Build Static Loader from master
run: |
cd master
mkdir build
cd build
cmake \
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_L0_LOADER_TESTS=1 \
-D BUILD_STATIC=1 \
..
make -j$(nproc)
# Build dynamic loader from PR branch
- name: Build Dynamic Loader from PR
run: |
cd pr
mkdir dynamic_build
cd dynamic_build
cmake \
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_STATIC=0 \
-D BUILD_L0_LOADER_TESTS=1 \
..
make -j$(nproc)
# Run CTest in static loader's build directory, using PR dynamic loader via ZEL_LIBRARY_PATH
- name: Run CTest with PR dynamic loader and master static loader
env:
ZEL_LIBRARY_PATH: '${{ github.workspace }}/pr/dynamic_build/lib'
working-directory: master/build
run: |
ls $ZEL_LIBRARY_PATH
ctest -V
# Windows job: Build static loader from master, dynamic loader from PR, test static loader with PR dynamic loader
build-windows:
if: github.repository_owner == 'oneapi-src'
runs-on: windows-latest
steps:
# Checkout PR branch (dynamic loader source)
- uses: actions/checkout@v3
with:
fetch-depth: 0
path: pr
# Checkout master branch for static loader source
- name: Checkout master branch for static loader
uses: actions/checkout@v3
with:
ref: master
fetch-depth: 0
path: master
- name: Setup Windows build environment
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
# Build static loader from master branch
- name: Build Static Loader from master
run: |
cd master
mkdir build
cd build
cmake -G "Ninja" -D CMAKE_BUILD_TYPE=Release -D BUILD_L0_LOADER_TESTS=1 -D BUILD_STATIC=1 ..
cmake --build .
# TEMPORARY WORKAROUND — safe to remove once this PR's changes have merged to master.
#
# Background: The CI was switched from the Visual Studio generator (-G "Visual Studio 17 2022")
# to Ninja (-G "Ninja") because windows-latest now ships with Visual Studio 2026 (v18),
# which CMake 3.31 does not recognise as a valid generator.
#
# The VS generator is multi-config and places build outputs under bin/<CONFIG>/
# (e.g. bin/Release/). Ninja is single-config and places outputs directly under bin/.
#
# master's test/CMakeLists.txt still contains hardcoded bin/$<CONFIG>/ paths in its
# CTest ENVIRONMENT properties (e.g. bin/Release/ze_null_test1.dll). This PR fixes
# those paths to use $<TARGET_FILE_DIR:ze_null_test1>/ which is generator-agnostic,
# but until that fix lands on master the n-1 build (which checks out master for the
# static loader) will fail to find the DLLs.
#
# This junction makes bin/Release/ point to bin/ so the old hardcoded paths resolve
# correctly. Once the fix is on master, Ninja will place DLLs in bin/ and the CTest
# properties will resolve directly there — this junction will never be traversed and
# can be removed along with this comment.
# This command assumes default shell is 'powershell'
if (-not (Test-Path bin\Release)) {
New-Item -ItemType Junction -Path bin\Release -Target (Resolve-Path bin).Path
}
# Build dynamic loader from PR branch
- name: Build Dynamic Loader from PR
run: |
cd pr
mkdir dynamic_build
cd dynamic_build
cmake -G "Ninja" -D CMAKE_BUILD_TYPE=Release -D BUILD_L0_LOADER_TESTS=0 -D BUILD_STATIC=0 ..
cmake --build .
# Run CTest in static loader's build directory, using PR dynamic loader via ZEL_LIBRARY_PATH
- name: Run CTest with PR dynamic loader and master static loader
env:
ZEL_LIBRARY_PATH: '${{ github.workspace }}\\pr\\dynamic_build\\bin'
working-directory: master/build
run: ctest -V