Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.

Commit 0ddba32

Browse files
Merge pull request #1152 from lukaszstolarczuk/fix-CI-scripts
Fix CI scripts
2 parents a05e6c1 + d44a474 commit 0ddba32

File tree

8 files changed

+38
-39
lines changed

8 files changed

+38
-39
lines changed

.github/workflows/coverity.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11

22
name: CPP-coverity
3+
# It runs static analysis build - Coverity. It requires special token (set in CI's secret).
4+
35
on:
46
schedule:
57
# run this job at 00:00 UTC everyday

.github/workflows/gha.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: CPP
2-
# It runs deafult OSes for each PR, push event or a new tag,
2+
# It runs default OSes for each PR, push event or a new tag,
33
# checks basic builds with various compilers and executes all sets of tests.
44

55
on:

.github/workflows/nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ env:
1313
CONTAINER_REG: ghcr.io/pmem/libpmemobj-cpp
1414
HOST_WORKDIR: ${{ github.workspace }}
1515
WORKDIR: utils/docker
16-
TEST_TIMEOUT: 600
16+
TEST_TIMEOUT: 900
1717
IMG_VER: latest
1818
TYPE: debug
1919
PUSH_IMAGE: 1

.github/workflows/weekly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ env:
1313
CONTAINER_REG: ghcr.io/pmem/libpmemobj-cpp
1414
HOST_WORKDIR: ${{ github.workspace }}
1515
WORKDIR: utils/docker
16-
TEST_TIMEOUT: 600
16+
TEST_TIMEOUT: 900
1717
IMG_VER: latest
1818
PUSH_IMAGE: 0
1919

utils/docker/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
set -e
2323

24-
source $(dirname $0)/set-ci-vars.sh
24+
source $(dirname ${0})/set-ci-vars.sh
2525
IMG_VER=${IMG_VER:-devel}
2626
TAG="${OS}-${OS_VER}-${IMG_VER}"
2727
IMAGE_NAME=${CONTAINER_REG}:${TAG}
@@ -48,7 +48,7 @@ if [[ -z "${CONTAINER_REG}" ]]; then
4848
fi
4949

5050
# Set command to execute in the Docker container
51-
if [[ -z "$COMMAND" ]]; then
51+
if [[ -z "${COMMAND}" ]]; then
5252
echo "COMMAND will be based on the type of build: ${TYPE}"
5353
case ${TYPE} in
5454
debug)

utils/docker/images/Dockerfile.fedora-rawhide

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ ARG TESTS_DEPS="\
4747
libpmem-devel \
4848
libunwind-devel \
4949
pmempool \
50+
rpm-build \
5051
valgrind-devel"
5152

5253
# Misc for our builds/CI (optional)

utils/docker/prepare-for-build.sh

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,15 @@
1010

1111
set -e
1212

13-
if [[ -z "${WORKDIR}" ]]; then
14-
echo "ERROR: The variable WORKDIR has to contain a path to the root " \
15-
"of this project - 'build' sub-directory will be created there."
16-
exit 1
17-
fi
18-
1913
INSTALL_DIR=/tmp/libpmemobj-cpp
2014
EXAMPLE_TEST_DIR=/tmp/build_example
2115
TEST_DIR=${PMEMKV_TEST_DIR:-${DEFAULT_TEST_DIR}}
2216

17+
### Helper functions, used in run-*.sh scripts
2318
function sudo_password() {
2419
echo ${USERPASS} | sudo -Sk $*
2520
}
2621

27-
echo "Current WORKDIR content:"
28-
ls ${WORKDIR} -alh
29-
30-
if [ "${CI_RUN}" == "YES" ]; then
31-
echo "CI build: change WORKDIR's owner and prepare tmpfs device"
32-
sudo_password chown -R $(id -u).$(id -g) ${WORKDIR}
33-
34-
sudo_password mkdir ${TEST_DIR}
35-
sudo_password chmod 0777 ${TEST_DIR}
36-
sudo_password mount -o size=2G -t tmpfs none ${TEST_DIR}
37-
fi || true
38-
39-
40-
## Helper functions, used in run-*.sh scripts
4122
function workspace_cleanup() {
4223
echo "Cleanup build dirs"
4324

@@ -92,3 +73,20 @@ function compile_example_standalone() {
9273
make -j$(nproc)
9374
cd -
9475
}
76+
77+
### Additional checks, to be run, when this file is sourced
78+
if [[ -z "${WORKDIR}" ]]; then
79+
echo "ERROR: The variable WORKDIR has to contain a path to the root " \
80+
"of this project - 'build' sub-directory will be created there."
81+
exit 1
82+
fi
83+
84+
# this should be run only on CIs
85+
if [ "${CI_RUN}" == "YES" ]; then
86+
echo "CI build: change WORKDIR's owner and prepare tmpfs device"
87+
sudo_password chown -R $(id -u).$(id -g) ${WORKDIR}
88+
89+
sudo_password mkdir ${TEST_DIR}
90+
sudo_password chmod 0777 ${TEST_DIR}
91+
sudo_password mount -o size=2G -t tmpfs none ${TEST_DIR}
92+
fi || true

utils/docker/run-build.sh

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -215,23 +215,21 @@ function tests_package() {
215215

216216
[ ! "${TESTS_PACKAGES}" = "ON" ] && echo "Skipping testing packages, TESTS_PACKAGES variable is not set."
217217

218-
if ! ls /opt/pmdk-pkg/libpmem* > /dev/null 2>&1; then
219-
echo "ERROR: There are no PMDK packages in /opt/pmdk-pkg - they are required for package test(s)."
220-
printf "$(tput setaf 1)$(tput setab 7)BUILD ${FUNCNAME[0]} END$(tput sgr 0)\n\n"
221-
return 1
222-
fi
223-
224218
mkdir build
225219
cd build
226220

227-
if [ ${PACKAGE_MANAGER} = "deb" ]; then
228-
sudo_password dpkg -i /opt/pmdk-pkg/libpmem_*.deb /opt/pmdk-pkg/libpmem-dev_*.deb
229-
sudo_password dpkg -i /opt/pmdk-pkg/libpmemobj_*.deb /opt/pmdk-pkg/libpmemobj-dev_*.deb
230-
elif [ ${PACKAGE_MANAGER} = "rpm" ]; then
231-
sudo_password rpm -i /opt/pmdk-pkg/libpmem*.rpm /opt/pmdk-pkg/pmdk-debuginfo-*.rpm
232-
else
233-
echo "ERROR: skipping building of packages because PACKAGE_MANAGER is not equal to 'rpm' nor 'deb' ..."
234-
return 1
221+
if ls /opt/pmdk-pkg/libpmem* > /dev/null 2>&1; then
222+
echo "There are packages to install in '/opt/pmdk-pkg'"
223+
224+
if [ ${PACKAGE_MANAGER} = "deb" ]; then
225+
sudo_password dpkg -i /opt/pmdk-pkg/libpmem_*.deb /opt/pmdk-pkg/libpmem-dev_*.deb
226+
sudo_password dpkg -i /opt/pmdk-pkg/libpmemobj_*.deb /opt/pmdk-pkg/libpmemobj-dev_*.deb
227+
elif [ ${PACKAGE_MANAGER} = "rpm" ]; then
228+
sudo_password rpm -i /opt/pmdk-pkg/libpmem*.rpm /opt/pmdk-pkg/pmdk-debuginfo-*.rpm
229+
else
230+
echo "ERROR: we found packages to install, but PACKAGE_MANAGER is not set (to 'rpm', or 'deb')!"
231+
return 1
232+
fi
235233
fi
236234

237235
CC=gcc CXX=g++ \

0 commit comments

Comments
 (0)