Skip to content

Commit 92ac4f6

Browse files
committed
Update CI to use Docker
- Updated reusable_basic.yml and reusable_fast.yml to use Docker images. - Added install_oneAPI.sh to support image setup.
1 parent 941e435 commit 92ac4f6

File tree

4 files changed

+115
-68
lines changed

4 files changed

+115
-68
lines changed

.github/scripts/install_oneAPI.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
# Copyright (C) 2025 Intel Corporation
3+
# Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
4+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
5+
6+
# install_oneAPI.sh - Script for installing Intel oneAPI from the official repository
7+
8+
apt-get update
9+
apt-get install -y gpg-agent gnupg
10+
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor -o /usr/share/keyrings/oneapi-archive-keyring.gpg
11+
echo 'deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main' > /etc/apt/sources.list.d/oneAPI.list
12+
apt-get update
13+
apt-get install -y intel-oneapi-ippcp-devel intel-oneapi-ipp-devel intel-oneapi-common-oneapi-vars intel-oneapi-compiler-dpcpp-cpp

.github/workflows/pr_push.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,18 @@ concurrency:
1414

1515
permissions:
1616
contents: read
17+
packages: read
1718

1819
jobs:
1920
CodeChecks:
2021
uses: ./.github/workflows/reusable_checks.yml
2122
FastBuild:
2223
name: Fast builds
23-
needs: [CodeChecks]
24+
# needs: [CodeChecks]
2425
uses: ./.github/workflows/reusable_fast.yml
2526
Build:
2627
name: Basic builds
27-
needs: [FastBuild]
28+
# needs: [FastBuild]
2829
uses: ./.github/workflows/reusable_basic.yml
2930
DevDax:
3031
needs: [FastBuild]

.github/workflows/reusable_basic.yml

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on: workflow_call
55

66
permissions:
77
contents: read
8+
packages: read
89

910
env:
1011
BUILD_DIR : "${{github.workspace}}/build"
@@ -15,6 +16,13 @@ env:
1516
jobs:
1617
ubuntu-build:
1718
name: Ubuntu
19+
runs-on: ubuntu-latest
20+
container:
21+
# image: ghcr.io/bb-ur/umf-${{ matrix.os }}:latest
22+
image: ghcr.io/rbanka1/umf-${{ matrix.os }}:latest
23+
options: --privileged
24+
volumes:
25+
- ${{ github.workspace }}:${{ github.workspace }}
1826
strategy:
1927
matrix:
2028
os: ['ubuntu-22.04', 'ubuntu-24.04']
@@ -93,7 +101,7 @@ jobs:
93101
link_hwloc_statically: 'OFF'
94102
llvm_linker: '-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_MODULE_LINKER_FLAGS="-fuse-ld=lld" -DCMAKE_SHARED_LINKER_FLAGS="-fuse-ld=lld"'
95103
cmake_ver: 'default'
96-
# test without installing TBB
104+
# test without installing TBB
97105
- os: 'ubuntu-22.04'
98106
build_type: Release
99107
compiler: {c: gcc, cxx: g++}
@@ -124,52 +132,34 @@ jobs:
124132
disable_hwloc: 'OFF'
125133
link_hwloc_statically: 'ON'
126134
cmake_ver: 'default'
127-
runs-on: ${{matrix.os}}
128-
129135
steps:
130136
- name: Checkout
131137
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
132138
with:
133139
fetch-depth: 0
134140

135-
- name: Install apt packages
136-
run: |
137-
sudo apt-get update
138-
sudo apt-get install -y clang libnuma-dev lcov
139-
140141
- name: Install cmake (non-default version)
141142
if: matrix.cmake_ver != 'default'
142143
run: |
143-
sudo apt-get remove --purge -y cmake
144+
echo ${USERPASS} | sudo -Sk apt-get remove --purge -y cmake
144145
wget https://github.com/Kitware/CMake/releases/download/v${{matrix.cmake_ver}}/cmake-${{matrix.cmake_ver}}-Linux-x86_64.sh
145146
chmod +x cmake-${{matrix.cmake_ver}}-Linux-x86_64.sh
146-
sudo ./cmake-${{matrix.cmake_ver}}-Linux-x86_64.sh --skip-license --prefix=/usr/local
147-
148-
- name: Install hwloc
149-
if: matrix.disable_hwloc == 'OFF'
150-
run: |
151-
sudo apt-get install -y libhwloc-dev
147+
echo ${USERPASS} | sudo -Sk ./cmake-${{matrix.cmake_ver}}-Linux-x86_64.sh --skip-license --prefix=/usr/local
152148
153-
- name: Install TBB apt package
154-
if: matrix.install_tbb == 'ON'
149+
- name: Uninstall TBB apt package
150+
if: matrix.install_tbb == 'OFF'
155151
run: |
156-
sudo apt-get install -y libtbb-dev
152+
echo ${USERPASS} | sudo -Sk apt-get remove --purge -y libtbb-dev
157153
158154
- name: Install oneAPI basekit
159155
if: matrix.compiler.cxx == 'icpx'
156+
# Installing via script to avoid installing multi-line bash command by root
160157
run: |
161-
sudo apt-get install -y gpg-agent wget
162-
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
163-
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
164-
sudo apt-get update
165-
sudo apt-get install -y intel-oneapi-ippcp-devel intel-oneapi-ipp-devel intel-oneapi-common-oneapi-vars intel-oneapi-compiler-dpcpp-cpp
166-
167-
- name: Install g++-7
168-
if: matrix.compiler.cxx == 'g++-7'
169-
run: sudo apt-get install -y ${{matrix.compiler.cxx}}
158+
echo "${USERPASS}" | sudo -Sk ./.github/scripts/install_oneAPI.sh
170159
171160
- name: Get UMF version
172161
run: |
162+
git config --global --add safe.directory $GITHUB_WORKSPACE
173163
VERSION=$(git describe --tags --abbrev=0 | grep -oP '\d+\.\d+\.\d+')
174164
echo "UMF_VERSION=$VERSION" >> $GITHUB_ENV
175165

.github/workflows/reusable_fast.yml

Lines changed: 82 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,107 @@
1-
# Fast builds
1+
# Fast build linux part is working in dockers, Windows is not
22
name: FastBuild
33

44
on: workflow_call
55

66
permissions:
77
contents: read
8+
packages: read
89

910
env:
1011
BUILD_DIR : "${{github.workspace}}/build"
1112
INSTL_DIR : "${{github.workspace}}/install-dir"
1213

1314
jobs:
14-
FastBuild:
15-
name: Fast builds
16-
env:
17-
VCPKG_PATH: "${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows"
15+
ubuntu-build:
16+
name: Linux
17+
runs-on: ${{ github.repository_owner == 'oneapi-src' && 'intel-ubuntu-22.04' || 'ubuntu-22.04' }}
18+
container:
19+
# image: ghcr.io/bb-ur/umf-${{ matrix.os }}:latest
20+
image: ghcr.io/rbanka1/umf-${{ matrix.os }}:latest
21+
options: --user test_user --privileged
22+
volumes:
23+
- ${{ github.workspace }}:${{ github.workspace }}
1824
strategy:
1925
matrix:
2026
include:
21-
- os: windows-latest
27+
- os: 'ubuntu-22.04'
2228
build_tests: 'ON'
29+
extra_build_options: ' -DUMF_BUILD_BENCHMARKS=ON -DUMF_BUILD_BENCHMARKS_MT=ON'
2330
simple_cmake: 'OFF'
24-
# pure C build (Windows)
25-
- os: windows-latest
31+
# pure C build
32+
- os: 'ubuntu-22.04'
2633
# Tests' building is off for a pure C build
2734
build_tests: 'OFF'
35+
extra_build_options: '-DUMF_BUILD_BENCHMARKS=ON'
2836
simple_cmake: 'OFF'
29-
- os: ubuntu-latest
37+
# simplest CMake on Ubuntu 22.04, 24.04
38+
- os: 'ubuntu-22.04'
3039
build_tests: 'ON'
31-
# Windows doesn't recognize 'CMAKE_BUILD_TYPE', it uses '--config' param in build command
32-
extra_build_options: '-DCMAKE_BUILD_TYPE=Release -DUMF_BUILD_BENCHMARKS=ON -DUMF_BUILD_BENCHMARKS_MT=ON'
33-
simple_cmake: 'OFF'
34-
# pure C build (Linux)
35-
- os: ubuntu-latest
36-
# Windows doesn't recognize 'CMAKE_BUILD_TYPE', it uses '--config' param in build command
37-
# Tests' building is off for a pure C build
38-
build_tests: 'OFF'
39-
extra_build_options: '-DCMAKE_BUILD_TYPE=Release -DUMF_BUILD_BENCHMARKS=ON'
40-
simple_cmake: 'OFF'
41-
# simplest CMake on ubuntu-latest
42-
- os: ubuntu-latest
43-
build_tests: 'ON'
44-
extra_build_options: '-DCMAKE_BUILD_TYPE=Release'
4540
simple_cmake: 'ON'
46-
# simplest CMake ubuntu-22.04
47-
- os: ubuntu-22.04
41+
- os: ubuntu-24.04
4842
build_tests: 'ON'
49-
extra_build_options: '-DCMAKE_BUILD_TYPE=Release'
5043
simple_cmake: 'ON'
51-
runs-on: ${{ (matrix.os == 'ubuntu-latest' && github.repository_owner == 'oneapi-src') && 'intel-ubuntu-22.04' || matrix.os }}
44+
45+
steps:
46+
- name: Checkout repository
47+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
48+
with:
49+
fetch-depth: 0
50+
51+
- name: Configure CMake
52+
if: matrix.simple_cmake == 'OFF'
53+
run: >
54+
cmake
55+
-B ${{env.BUILD_DIR}}
56+
-DCMAKE_BUILD_TYPE=Release
57+
-DUMF_FORMAT_CODE_STYLE=OFF
58+
-DUMF_DEVELOPER_MODE=ON
59+
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
60+
-DUMF_BUILD_TESTS=${{matrix.build_tests}}
61+
-DUMF_BUILD_EXAMPLES=ON
62+
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
63+
-DUMF_BUILD_CUDA_PROVIDER=ON
64+
-DUMF_TESTS_FAIL_ON_SKIP=ON
65+
-DUMF_BUILD_SHARED_LIBRARY=ON
66+
${{matrix.extra_build_options}}
67+
68+
- name: Configure CMake (simple)
69+
if: matrix.simple_cmake == 'ON'
70+
run: >
71+
cmake
72+
-B ${{env.BUILD_DIR}}
73+
-DCMAKE_BUILD_TYPE=Release
74+
-DUMF_BUILD_SHARED_LIBRARY=ON
75+
-DUMF_TESTS_FAIL_ON_SKIP=ON
76+
${{matrix.extra_build_options}}
77+
78+
- name: Build
79+
run: cmake --build ${{env.BUILD_DIR}} --config Release -j $(nproc)
80+
81+
- name: Run examples
82+
working-directory: ${{env.BUILD_DIR}}
83+
run: ctest --output-on-failure --test-dir examples -C Release
84+
85+
- name: Run tests
86+
if: matrix.build_tests == 'ON'
87+
working-directory: ${{env.BUILD_DIR}}
88+
run: ctest --output-on-failure --test-dir test -C Release
89+
90+
windows-build:
91+
name: Windows
92+
runs-on: windows-latest
93+
94+
env:
95+
VCPKG_PATH: "${{github.workspace}}/build/vcpkg/packages/hwloc_x64-windows;${{github.workspace}}/build/vcpkg/packages/tbb_x64-windows;${{github.workspace}}/build/vcpkg/packages/jemalloc_x64-windows"
96+
strategy:
97+
matrix:
98+
include:
99+
- build_tests: 'ON'
100+
simple_cmake: 'OFF'
101+
- build_tests: 'OFF'
102+
simple_cmake: 'OFF'
103+
- build_tests: 'OFF'
104+
simple_cmake: 'ON'
52105

53106
steps:
54107
- name: Checkout repository
@@ -57,24 +110,16 @@ jobs:
57110
fetch-depth: 0
58111

59112
- name: Initialize vcpkg
60-
if: matrix.os == 'windows-latest'
61113
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
62114
with:
63115
vcpkgGitCommitId: ea2a964f9303270322cf3f2d51c265ba146c422d # 1.04.2025
64116
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
65117
vcpkgJsonGlob: '**/vcpkg.json'
66118

67-
- name: Install dependencies (windows-latest)
68-
if: matrix.os == 'windows-latest'
119+
- name: Install dependencies
69120
run: vcpkg install --triplet x64-windows
70121
shell: pwsh # Specifies PowerShell as the shell for running the script.
71122

72-
- name: Install dependencies
73-
if: matrix.os != 'windows-latest'
74-
run: |
75-
sudo apt-get update
76-
sudo apt-get install -y cmake libhwloc-dev libnuma-dev libtbb-dev
77-
78123
- name: Configure CMake
79124
if: matrix.simple_cmake == 'OFF'
80125
run: >
@@ -91,17 +136,16 @@ jobs:
91136
-DUMF_BUILD_CUDA_PROVIDER=ON
92137
-DUMF_TESTS_FAIL_ON_SKIP=ON
93138
-DUMF_BUILD_SHARED_LIBRARY=ON
94-
${{matrix.extra_build_options}}
95139
96140
- name: Configure CMake (simple)
97141
if: matrix.simple_cmake == 'ON'
98142
run: >
99143
cmake
100144
-B ${{env.BUILD_DIR}}
101145
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
146+
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
102147
-DUMF_BUILD_SHARED_LIBRARY=ON
103148
-DUMF_TESTS_FAIL_ON_SKIP=ON
104-
${{matrix.extra_build_options}}
105149
106150
- name: Build
107151
run: cmake --build ${{env.BUILD_DIR}} --config Release -j
@@ -118,7 +162,6 @@ jobs:
118162
# TODO: We could add some script to verify metadata of dll's (selected fields, perhaps)
119163
# ref. https://superuser.com/questions/381276/what-are-some-nice-command-line-ways-to-inspect-dll-exe-details
120164
- name: Print metadata of our dll's
121-
if: matrix.os == 'windows-latest'
122165
run: |
123166
get-command ${{github.workspace}}/build/bin/Release/umf.dll | format-list
124167
get-command ${{github.workspace}}/build/src/proxy_lib/Release/umf_proxy.dll | format-list

0 commit comments

Comments
 (0)