1+ # Workflow for checkig the backward compatibility of UMF.
2+ # Test the latest UMF shared library with binaries compiled using the older UMF
3+ # shared library.
4+ name : Compatibility
5+
6+ on :
7+ workflow_call :
8+ inputs :
9+ tag :
10+ description : Check backward compatibility with this tag
11+ type : string
12+ default : " v0.10.1"
13+
14+ permissions :
15+ contents : read
16+
17+ jobs :
18+ ubuntu-build :
19+ name : Ubuntu
20+ runs-on : ' ubuntu-22.04'
21+
22+ steps :
23+ # NOTE: we need jemalloc for older version of UMF
24+ - name : Install apt packages
25+ run : |
26+ sudo apt-get update
27+ sudo apt-get install -y clang cmake libnuma-dev libjemalloc-dev libtbb-dev
28+
29+ - name : Checkout "tag" UMF version
30+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
31+ with :
32+ fetch-depth : 0
33+ ref : refs/tags/${{inputs.tag}}
34+ path : ${{github.workspace}}/tag_version
35+
36+ - name : Install libhwloc
37+ working-directory : ${{github.workspace}}/tag_version
38+ run : .github/scripts/install_hwloc.sh
39+
40+ - name : Get "tag" UMF version
41+ working-directory : ${{github.workspace}}/tag_version
42+ run : |
43+ VERSION=$(git describe --tags --abbrev=0 | grep -oP '\d+\.\d+\.\d+')
44+ echo "tag version: $VERSION"
45+
46+ - name : Configure "tag" UMF build
47+ working-directory : ${{github.workspace}}/tag_version
48+ run : >
49+ cmake
50+ -B ${{github.workspace}}/tag_version/build
51+ -DCMAKE_INSTALL_PREFIX="${{github.workspace}}/tag_version/build/install"
52+ -DCMAKE_BUILD_TYPE=Debug
53+ -DUMF_BUILD_SHARED_LIBRARY=ON
54+ -DCMAKE_C_COMPILER=gcc
55+ -DCMAKE_CXX_COMPILER=g++
56+ -DUMF_BUILD_TESTS=ON
57+ -DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
58+ -DUMF_BUILD_CUDA_PROVIDER=ON
59+ -DUMF_FORMAT_CODE_STYLE=OFF
60+ -DUMF_DEVELOPER_MODE=ON
61+ -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
62+ -DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
63+ -DUMF_TESTS_FAIL_ON_SKIP=ON
64+
65+ - name : Build "tag" UMF
66+ working-directory : ${{github.workspace}}/tag_version
67+ run : |
68+ cmake --build ${{github.workspace}}/tag_version/build -j $(nproc)
69+
70+ # For UMF < 0.11 set ptrace_scope
71+ - name : Set ptrace value for IPC test
72+ if : ${{ startsWith(inputs.tag, 'v0.10.') || startsWith(inputs.tag, 'v0.9.') }}
73+ run : sudo bash -c "echo 0 > /proc/sys/kernel/yama/ptrace_scope"
74+
75+ - name : Run "tag" UMF tests
76+ working-directory : ${{github.workspace}}/tag_version/build
77+ run : |
78+ LD_LIBRARY_PATH=${{github.workspace}}/tag_version/build/lib/ ctest --output-on-failure
79+
80+ - name : Checkout latest UMF version
81+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
82+ with :
83+ fetch-depth : 0
84+ path : ${{github.workspace}}/latest_version
85+
86+ - name : Get latest UMF version
87+ working-directory : ${{github.workspace}}/latest_version
88+ run : |
89+ VERSION=$(git describe --tags --abbrev=0 | grep -oP '\d+\.\d+\.\d+')
90+ echo "checked version: $VERSION"
91+
92+ - name : Configure latest UMF build
93+ working-directory : ${{github.workspace}}/latest_version
94+ run : >
95+ cmake
96+ -B ${{github.workspace}}/latest_version/build
97+ -DCMAKE_INSTALL_PREFIX="${{github.workspace}}/latest_version/build/install"
98+ -DCMAKE_BUILD_TYPE=Debug
99+ -DUMF_BUILD_SHARED_LIBRARY=ON
100+ -DCMAKE_C_COMPILER=gcc
101+ -DCMAKE_CXX_COMPILER=g++
102+ -DUMF_BUILD_TESTS=ON
103+ -DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
104+ -DUMF_BUILD_CUDA_PROVIDER=ON
105+ -DUMF_FORMAT_CODE_STYLE=OFF
106+ -DUMF_DEVELOPER_MODE=ON
107+ -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
108+ -DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
109+ -DUMF_TESTS_FAIL_ON_SKIP=ON
110+
111+ - name : Build latest UMF
112+ working-directory : ${{github.workspace}}/latest_version
113+ run : |
114+ cmake --build ${{github.workspace}}/latest_version/build -j $(nproc)
115+
116+ # NOTE: exclude umf-provider_coarse, umf-disjointCoarseMallocPool,
117+ # umf-jemalloc_coarse_file, umf-scalable_coarse_file as they use Coarse
118+ # Provider which is not supported for UMF > 0.10.0
119+ - name : Run "tag" UMF tests with latest UMF libs (warnings enabled)
120+ working-directory : ${{github.workspace}}/tag_version/build
121+ run : >
122+ UMF_LOG="level:warning;flush:debug;output:stderr;pid:no"
123+ LD_LIBRARY_PATH=${{github.workspace}}/latest_version/build/lib/
124+ ctest --output-on-failure -E "umf-provider_coarse|umf-disjointCoarseMallocPool|umf-jemalloc_coarse_file|umf-scalable_coarse_file"
125+
126+ windows-build :
127+ name : Windows
128+ env :
129+ VCPKG_PATH : " ${{github.workspace}}/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/vcpkg/packages/jemalloc_x64-windows"
130+ runs-on : " windows-2022"
131+
132+ steps :
133+ - name : Checkout "tag" UMF version
134+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
135+ with :
136+ fetch-depth : 0
137+ ref : refs/tags/${{inputs.tag}}
138+ path : ${{github.workspace}}/tag_version
139+
140+ - name : Initialize vcpkg
141+ uses : lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
142+ with :
143+ vcpkgGitCommitId : 3dd44b931481d7a8e9ba412621fa810232b66289
144+ vcpkgDirectory : ${{github.workspace}}/vcpkg
145+ vcpkgJsonGlob : ' **/vcpkg.json'
146+
147+ - name : Install dependencies
148+ working-directory : ${{github.workspace}}/tag_version
149+ run : vcpkg install
150+ shell : pwsh # Specifies PowerShell as the shell for running the script.
151+
152+ - name : Get "tag" UMF version
153+ working-directory : ${{github.workspace}}/tag_version
154+ run : |
155+ $version = (git describe --tags --abbrev=0 | Select-String -Pattern '\d+\.\d+\.\d+').Matches.Value
156+ echo "tag version: $VERSION"
157+ shell : pwsh
158+
159+ - name : Configure "tag" UMF build
160+ working-directory : ${{github.workspace}}/tag_version
161+ run : >
162+ cmake
163+ -B "${{github.workspace}}/tag_version/build"
164+ -DCMAKE_INSTALL_PREFIX="${{github.workspace}}/tag_version/install"
165+ -DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
166+ -DCMAKE_C_COMPILER=cl
167+ -DCMAKE_CXX_COMPILER=cl
168+ -DUMF_BUILD_SHARED_LIBRARY=ON
169+ -DUMF_BUILD_TESTS=ON
170+ -DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
171+ -DUMF_BUILD_CUDA_PROVIDER=ON
172+ -DUMF_FORMAT_CODE_STYLE=OFF
173+ -DUMF_DEVELOPER_MODE=ON
174+ -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
175+ -DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
176+ -DUMF_TESTS_FAIL_ON_SKIP=ON
177+
178+ - name : Build "tag" UMF
179+ run : cmake --build "${{github.workspace}}/tag_version/build" --config Debug -j $Env:NUMBER_OF_PROCESSORS
180+
181+ - name : Run "tag" UMF tests
182+ working-directory : " ${{github.workspace}}/tag_version/build"
183+ run : ctest -C Debug --output-on-failure --test-dir test
184+
185+ - name : Checkout latest UMF version
186+ uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
187+ with :
188+ fetch-depth : 0
189+ path : ${{github.workspace}}/latest_version
190+
191+ # NOTE we use vcpkg setup from "tag" version
192+ - name : Get latest UMF version
193+ working-directory : ${{github.workspace}}/latest_version
194+ run : |
195+ $version = (git describe --tags --abbrev=0 | Select-String -Pattern '\d+\.\d+\.\d+').Matches.Value
196+ echo "latest version: $VERSION"
197+ shell : pwsh
198+
199+ - name : Configure latest UMF build
200+ working-directory : ${{github.workspace}}/latest_version
201+ run : >
202+ cmake
203+ -B "${{github.workspace}}/latest_version/build"
204+ -DCMAKE_INSTALL_PREFIX="${{github.workspace}}/latest_version/install"
205+ -DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
206+ -DCMAKE_C_COMPILER=cl
207+ -DCMAKE_CXX_COMPILER=cl
208+ -DUMF_BUILD_SHARED_LIBRARY=ON
209+ -DUMF_BUILD_TESTS=ON
210+ -DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
211+ -DUMF_BUILD_CUDA_PROVIDER=ON
212+ -DUMF_FORMAT_CODE_STYLE=OFF
213+ -DUMF_DEVELOPER_MODE=ON
214+ -DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
215+ -DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
216+ -DUMF_TESTS_FAIL_ON_SKIP=ON
217+
218+ - name : Build latest UMF
219+ run : cmake --build "${{github.workspace}}/latest_version/build" --config Debug -j $Env:NUMBER_OF_PROCESSORS
220+
221+ - name : Run "tag" UMF tests with latest UMF libs (warnings enabled)
222+ working-directory : ${{github.workspace}}/tag_version/build
223+ run : >
224+ ctest -C Debug --output-on-failure --test-dir test
225+
226+ # on Windows we simply overwrite the umf.dll
227+ # NOTE: exclude umf-provider_coarse, umf-disjointCoarseMallocPool,
228+ # umf-jemalloc_coarse_file, umf-scalable_coarse_file as they use Coarse
229+ # Provider which is not supported for UMF > 0.10.0
230+ - name : Run "tag" UMF tests with latest UMF libs (warnings enabled)
231+ working-directory : ${{github.workspace}}/tag_version/build
232+ run : |
233+ $env:UMF_LOG="level:warning;flush:debug;output:stderr;pid:no"
234+ echo $env:UMF_LOG
235+ ctest --output-on-failure
236+
0 commit comments