Skip to content

Commit

Permalink
Changed workflow to include matrix for multiple flavors of linux
Browse files Browse the repository at this point in the history
Added a matrix to run the CI using multiple flavors of Linux, to
test the building and installing process with different variants of
Linux.
  • Loading branch information
MigeljanImeri committed Sep 12, 2023
1 parent 12ecc0b commit e488d2d
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 35 deletions.
61 changes: 27 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,37 @@ jobs:
name: build

runs-on: ubuntu-latest
strategy:
matrix:
img: ["ubuntu:20.04", "ubuntu:22.04", "centos:8" ]
fail-fast: true
container:
image: ${{ matrix.img }}

steps:
- uses: actions/checkout@v3
- name: apt update
run: sudo apt-get update
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: xfsprogs gnuplot net-tools numactl libnuma-dev xfslibs-dev bc time strace
version: 1.0
- name: configure
run: cmake -B ${{github.workspace}}/build
- name: make
run: make -C ${{github.workspace}}/build
- name: make install
run: sudo make -C ${{github.workspace}}/build install
- name: run tests
run: ctest --output-on-failure
working-directory: ${{github.workspace}}/build
deb:

runs-on: ubuntu-latest
- name: Ubuntu Prerequisites
if: startsWith(matrix.img, 'ubuntu:')
run: contrib/CI/ubuntu.sh

steps:
- uses: actions/checkout@v3
- name: apt update
run: sudo apt-get update
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: xfsprogs gnuplot net-tools numactl libnuma-dev xfslibs-dev bc time strace
version: 1.0
- name: configure
run: cmake -B ${{github.workspace}}/build
- name: make
- name: CentOS 8 Prerequisites
if: matrix.img == 'centos:8'
run: contrib/CI/centos8.sh

- name: Configure
run: cmake -B ${{github.workspace}}/build

- name: Make
run: make -C ${{github.workspace}}/build
- name: build deb

- name: Make Package
run: make -C ${{github.workspace}}/build package
- name: install deb
run: sudo apt install -y ${{github.workspace}}/build/xdd-*.deb
- name: run tests
run: ctest --output-on-failure
working-directory: ${{github.workspace}}/build

- name: Install
run: make -C ${{github.workspace}}/build install

- name: Run Tests
run: |
cd ${{github.workspace}}/build
ctest --output-on-failure
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ set(PACKAGE_BUGREPORT "bug@xdd.org")
set(PACKAGE_TARNAME "${CMAKE_PROJECT_NAME}")

# Threads are required
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

# for finding packages with pkg-config
Expand Down Expand Up @@ -57,7 +58,6 @@ if (WITH_NUMA)

set(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, numactl-libs")
list(APPEND CPACK_DEBIAN_PACKAGE_DEPENDS "libnuma1")

set(HAVE_ENABLE_NUMA 1)
else()
message(STATUS "libnuma not found")
Expand Down
9 changes: 9 additions & 0 deletions contrib/CI/centos8.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

set -e
# taken from https://github.com/mar-file-system/GUFI/blob/master/contrib/CI/centos8.sh
# Point to appropriate repos, current is no longer supported
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

yum -y install cmake gcc rdma-core-devel numactl-devel pkgconf-pkg-config rpm-build bc time strace sudo
8 changes: 8 additions & 0 deletions contrib/CI/ubuntu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -e

apt-get update
apt install -y libnuma-dev libnuma1 cmake gcc pkg-config dpkg dpkg-dev sudo \
strace bc time libibverbs-dev

0 comments on commit e488d2d

Please sign in to comment.