Skip to content

Commit

Permalink
common: LDORAU test rpma on ALL Linux distros
Browse files Browse the repository at this point in the history
  • Loading branch information
ldorau committed Jan 24, 2022
1 parent f6ff3f1 commit b375a24
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 54 deletions.
44 changes: 0 additions & 44 deletions .github/workflows/on_pull_request.yml

This file was deleted.

107 changes: 107 additions & 0 deletions .github/workflows/test-all-oses.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@

name: TEST_ALL_OSes
on: [push, pull_request]

env:
GITHUB_REPO: ldorau/rpma
# use GitHub Container Registry as a repository of docker images
GH_CR_ADDR: ghcr.io
DOCKER_REPO: ghcr.io/ldorau/rpma
# use org's Private Access Token to log in to GitHub Container Registry
GH_CR_USER: ${{ secrets.GH_CR_USER }}
GH_CR_PAT: ${{ secrets.GH_CR_PAT }}
DOC_UPDATE_GITHUB_TOKEN: ${{ secrets.DOC_UPDATE_GITHUB_TOKEN }}
HOST_WORKDIR: /home/runner/work/rpma/rpma
WORKDIR: utils/docker
TYPE: normal

jobs:
gcc:
name: GCC
runs-on: ubuntu-latest
env:
CC: gcc
PUSH_IMAGE: 1
strategy:
fail-fast: false
matrix:
CONFIG: ["N=Ubuntu21.04 OS=ubuntu OS_VER=21.04",
"N=Ubuntu20.04 OS=ubuntu OS_VER=20.04",
"N=Fedora34 OS=fedora OS_VER=34",
"N=Fedora33 OS=fedora OS_VER=33",
"N=Fedora32 OS=fedora OS_VER=32",
"N=CentOS8 OS=centos OS_VER=8",
"N=CentOS7 OS=centos OS_VER=7 TEST_PYTHON_TOOLS=OFF",
"N=Debian11 OS=debian OS_VER=11",
"N=Debian10 OS=debian OS_VER=10",
"N=DebianS OS=debian OS_VER=stable",
# successors of CentOS:
"N=RockyLinux8.4 OS=rockylinux OS_VER=8.4",
"N=VzLinux8 OS=vzlinux OS_VER=latest",
# Rolling/testing/experimental distributions:
# (the Fedora_Rawhide build was moved to Nightly_Experimental)
"N=Ubuntu_Rolling OS=ubuntu OS_VER=rolling",
"N=Debian_Testing OS=debian OS_VER=testing",
"N=Debian_Experimental OS=debian OS_VER=experimental",
"N=Arch_Linux_Latest OS=archlinux OS_VER=latest",
"N=OpenSUSE_Leap OS=opensuse-leap OS_VER=latest",
"N=OpenSUSE_Tumbleweed OS=opensuse-tumbleweed OS_VER=latest"]
steps:
- name: Clone the git repo
uses: actions/checkout@v1

- name: Pull or rebuild the image
run: cd $WORKDIR && ${{ matrix.CONFIG }} ./pull-or-rebuild-image.sh

- name: Run the build
run: cd $WORKDIR && ${{ matrix.CONFIG }} ./build.sh

- name: Push the image
run: cd $WORKDIR && source ./set-vars.sh && ${{ matrix.CONFIG }} /bin/bash -c "if [[ -f ${CI_FILE_PUSH_IMAGE_TO_REPO} ]]; then images/push-image.sh; fi"

clang:
name: Clang
runs-on: ubuntu-latest
env:
CC: clang
strategy:
fail-fast: false
matrix:
CONFIG: ["N=Ubuntu21.04 OS=ubuntu OS_VER=21.04",
"N=Ubuntu20.04 OS=ubuntu OS_VER=20.04",
"N=Fedora34 OS=fedora OS_VER=34",
"N=Fedora33 OS=fedora OS_VER=33",
"N=Fedora32 OS=fedora OS_VER=32",
"N=CentOS8 OS=centos OS_VER=8",
"N=CentOS7 OS=centos OS_VER=7 TEST_PYTHON_TOOLS=OFF",
"N=Debian11 OS=debian OS_VER=11",
"N=Debian10 OS=debian OS_VER=10",
"N=DebianS OS=debian OS_VER=stable",
# successors of CentOS:
"N=RockyLinux8.4 OS=rockylinux OS_VER=8.4",
"N=VzLinux8 OS=vzlinux OS_VER=latest",
# Rolling/testing/experimental distributions:
# (the Fedora_Rawhide builds were moved to Nightly_Experimental)
#
# "N=Ubuntu_Rolling OS=ubuntu OS_VER=rolling",
# The following tests FAILED:
# 44 - flush-new_0_none (Failed)
# 45 - flush-apm_do_0_none (Failed)
#
"N=Debian_Testing OS=debian OS_VER=testing",
"N=Debian_Experimental OS=debian OS_VER=experimental",
"N=Arch_Linux_Latest OS=archlinux OS_VER=latest",
"N=OpenSUSE_Leap OS=opensuse-leap OS_VER=latest",
"N=OpenSUSE_Tumbleweed OS=opensuse-tumbleweed OS_VER=latest"]
steps:
- name: Clone the git repo
uses: actions/checkout@v1

- name: Pull or rebuild the image
run: cd $WORKDIR && ${{ matrix.CONFIG }} ./pull-or-rebuild-image.sh

- name: Run the build
run: cd $WORKDIR && ${{ matrix.CONFIG }} ./build.sh

- name: Push the image
run: cd $WORKDIR && source ./set-vars.sh && ${{ matrix.CONFIG }} /bin/bash -c "if [[ -f ${CI_FILE_PUSH_IMAGE_TO_REPO} ]]; then images/push-image.sh; fi"
15 changes: 5 additions & 10 deletions utils/docker/pull-or-rebuild-image.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
#
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016-2021, Intel Corporation
# Copyright 2016-2022, Intel Corporation
#

#
Expand Down Expand Up @@ -34,15 +34,7 @@ function rebuild_and_push_image()
popd

# Check if the image has to be pushed to ${DOCKER_REPO}
# (i.e. the build is triggered by commits to the ${GITHUB_REPO}
# repository's master branch, and the Travis build is not
# of the "pull_request" type). In that case, create the empty
# file.
if [[ "${CI_REPO_SLUG}" == "${GITHUB_REPO}" \
&& ($CI_BRANCH == stable-* || $CI_BRANCH == master) \
&& $CI_EVENT_TYPE != "pull_request"
&& $PUSH_IMAGE == "1" ]]
then
if [[ $PUSH_IMAGE == "1" ]]; then
echo "The image will be pushed to ${DOCKER_REPO}"
touch $CI_FILE_PUSH_IMAGE_TO_REPO
else
Expand Down Expand Up @@ -105,6 +97,9 @@ for file in $files; do
fi
done

# Log in to ${DOCKER_REPO}
echo "${GH_CR_PAT}" | docker login ${GH_CR_ADDR} -u="${GH_CR_USER}" --password-stdin

# Getting here means rebuilding the Docker image is not required.
# Pull the image from ${DOCKER_REPO}. If pulling fails
# (e.g. there is no desired image), then rebuild the image.
Expand Down

0 comments on commit b375a24

Please sign in to comment.