Skip to content

Commit a11848f

Browse files
committed
add backward compatibility workflow
1 parent cce29c1 commit a11848f

File tree

2 files changed

+232
-0
lines changed

2 files changed

+232
-0
lines changed

.github/workflows/pr_push.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,11 @@ jobs:
8585
contents: read
8686
security-events: write
8787
uses: ./.github/workflows/reusable_trivy.yml
88+
Compatibility:
89+
needs: [Build]
90+
uses: ./.github/workflows/reusable_compatibility.yml
91+
strategy:
92+
matrix:
93+
tag: ["v0.10.1"]
94+
with:
95+
tag: ${{matrix.tag}}
Lines changed: 224 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,224 @@
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)
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_BUILD_TYPE=Debug
52+
-DUMF_BUILD_SHARED_LIBRARY=ON
53+
-DCMAKE_C_COMPILER=gcc
54+
-DCMAKE_CXX_COMPILER=g++
55+
-DUMF_BUILD_TESTS=ON
56+
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
57+
-DUMF_BUILD_CUDA_PROVIDER=ON
58+
-DUMF_FORMAT_CODE_STYLE=OFF
59+
-DUMF_DEVELOPER_MODE=ON
60+
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
61+
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
62+
-DUMF_TESTS_FAIL_ON_SKIP=ON
63+
64+
- name: Build "tag" UMF
65+
working-directory: ${{github.workspace}}/tag_version
66+
run: |
67+
cmake --build ${{github.workspace}}/tag_version/build -j $(nproc)
68+
69+
# For UMF < 0.11 set ptrace_scope
70+
- name: Set ptrace value for IPC test
71+
if: ${{ startsWith(inputs.tag, 'v0.10.') || startsWith(inputs.tag, 'v0.9.') }}
72+
run: sudo bash -c "echo 0 > /proc/sys/kernel/yama/ptrace_scope"
73+
74+
- name: Run "tag" UMF tests
75+
working-directory: ${{github.workspace}}/tag_version/build
76+
run: |
77+
LD_LIBRARY_PATH=${{github.workspace}}/tag_version/build/lib/ ctest --output-on-failure
78+
79+
- name: Checkout latest UMF version
80+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
81+
with:
82+
fetch-depth: 0
83+
path: ${{github.workspace}}/latest_version
84+
85+
- name: Get latest UMF version
86+
working-directory: ${{github.workspace}}/latest_version
87+
run: |
88+
VERSION=$(git describe --tags)
89+
echo "checked version: $VERSION"
90+
91+
- name: Configure latest UMF build
92+
working-directory: ${{github.workspace}}/latest_version
93+
run: >
94+
cmake
95+
-B ${{github.workspace}}/latest_version/build
96+
-DCMAKE_BUILD_TYPE=Debug
97+
-DUMF_BUILD_SHARED_LIBRARY=ON
98+
-DCMAKE_C_COMPILER=gcc
99+
-DCMAKE_CXX_COMPILER=g++
100+
-DUMF_BUILD_TESTS=OFF
101+
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
102+
-DUMF_BUILD_CUDA_PROVIDER=ON
103+
-DUMF_FORMAT_CODE_STYLE=OFF
104+
-DUMF_DEVELOPER_MODE=ON
105+
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
106+
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
107+
-DUMF_TESTS_FAIL_ON_SKIP=ON
108+
109+
- name: Build latest UMF
110+
working-directory: ${{github.workspace}}/latest_version
111+
run: |
112+
cmake --build ${{github.workspace}}/latest_version/build -j $(nproc)
113+
114+
# NOTE: exclude umf-provider_coarse, umf-disjointCoarseMallocPool,
115+
# umf-jemalloc_coarse_file, umf-scalable_coarse_file as they use Coarse
116+
# Provider which is not supported for UMF > 0.10.0
117+
- name: Run "tag" UMF tests with latest UMF libs (warnings enabled)
118+
working-directory: ${{github.workspace}}/tag_version/build
119+
run: >
120+
UMF_LOG="level:warning;flush:debug;output:stderr;pid:no"
121+
LD_LIBRARY_PATH=${{github.workspace}}/latest_version/build/lib/
122+
ctest --output-on-failure -E "umf-provider_coarse|umf-disjointCoarseMallocPool|umf-jemalloc_coarse_file|umf-scalable_coarse_file"
123+
124+
windows-build:
125+
name: Windows
126+
env:
127+
VCPKG_PATH: "${{github.workspace}}/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/vcpkg/packages/jemalloc_x64-windows"
128+
runs-on: "windows-2022"
129+
130+
steps:
131+
- name: Checkout "tag" UMF version
132+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
133+
with:
134+
fetch-depth: 0
135+
ref: refs/tags/${{inputs.tag}}
136+
path: ${{github.workspace}}/tag_version
137+
138+
- name: Initialize vcpkg
139+
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
140+
with:
141+
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
142+
vcpkgDirectory: ${{github.workspace}}/vcpkg
143+
vcpkgJsonGlob: '**/vcpkg.json'
144+
145+
- name: Install dependencies
146+
working-directory: ${{github.workspace}}/tag_version
147+
run: vcpkg install
148+
shell: pwsh # Specifies PowerShell as the shell for running the script.
149+
150+
- name: Get "tag" UMF version
151+
working-directory: ${{github.workspace}}/tag_version
152+
run: |
153+
$version = (git describe --tags)
154+
echo "tag version: $VERSION"
155+
156+
- name: Configure "tag" UMF build
157+
working-directory: ${{github.workspace}}/tag_version
158+
run: >
159+
cmake
160+
-B "${{github.workspace}}/tag_version/build"
161+
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
162+
-DCMAKE_C_COMPILER=cl
163+
-DCMAKE_CXX_COMPILER=cl
164+
-DUMF_BUILD_SHARED_LIBRARY=ON
165+
-DUMF_BUILD_TESTS=ON
166+
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
167+
-DUMF_BUILD_CUDA_PROVIDER=ON
168+
-DUMF_FORMAT_CODE_STYLE=OFF
169+
-DUMF_DEVELOPER_MODE=ON
170+
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
171+
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
172+
-DUMF_TESTS_FAIL_ON_SKIP=ON
173+
174+
- name: Build "tag" UMF
175+
run: cmake --build "${{github.workspace}}/tag_version/build" --config Debug -j $Env:NUMBER_OF_PROCESSORS
176+
177+
- name: Run "tag" UMF tests
178+
working-directory: "${{github.workspace}}/tag_version/build"
179+
run: ctest -C Debug --output-on-failure --test-dir test
180+
181+
- name: Checkout latest UMF version
182+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
183+
with:
184+
fetch-depth: 0
185+
path: ${{github.workspace}}/latest_version
186+
187+
# NOTE we use vcpkg setup from "tag" version
188+
- name: Get latest UMF version
189+
working-directory: ${{github.workspace}}/latest_version
190+
run: |
191+
$version = (git describe --tags)
192+
echo "latest version: $VERSION"
193+
194+
- name: Configure latest UMF build
195+
working-directory: ${{github.workspace}}/latest_version
196+
run: >
197+
cmake
198+
-B "${{github.workspace}}/latest_version/build"
199+
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
200+
-DCMAKE_C_COMPILER=cl
201+
-DCMAKE_CXX_COMPILER=cl
202+
-DUMF_BUILD_SHARED_LIBRARY=ON
203+
-DUMF_BUILD_TESTS=OFF
204+
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
205+
-DUMF_BUILD_CUDA_PROVIDER=ON
206+
-DUMF_FORMAT_CODE_STYLE=OFF
207+
-DUMF_DEVELOPER_MODE=ON
208+
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
209+
-DUMF_BUILD_LIBUMF_POOL_DISJOINT=ON
210+
-DUMF_TESTS_FAIL_ON_SKIP=ON
211+
212+
- name: Build latest UMF
213+
run: cmake --build "${{github.workspace}}/latest_version/build" --config Debug -j $Env:NUMBER_OF_PROCESSORS
214+
215+
# NOTE: exclude umf-provider_coarse, umf-disjointCoarseMallocPool,
216+
# umf-jemalloc_coarse_file, umf-scalable_coarse_file as they use Coarse
217+
# Provider which is not supported for UMF > 0.10.0
218+
# NOTE2: on Windows we simply overwrite the umf.dll
219+
- name: Run "tag" UMF tests with latest UMF libs (warnings enabled)
220+
working-directory: ${{github.workspace}}/tag_version/build
221+
run: |
222+
$env:UMF_LOG="level:warning;flush:debug;output:stderr;pid:no"
223+
cp ${{github.workspace}}/latest_version/build/bin/Debug/umf.dll ${{github.workspace}}/tag_version/build/bin/Debug/umf.dll
224+
ctest -C Debug --output-on-failure --test-dir test -E "umf-provider_coarse|umf-disjointCoarseMallocPool|umf-jemalloc_coarse_file|umf-scalable_coarse_file"

0 commit comments

Comments
 (0)