Skip to content

Commit

Permalink
GitHub actions 9.1.x (#398)
Browse files Browse the repository at this point in the history
* new build with github action
  • Loading branch information
rigazilla authored Jul 28, 2022
1 parent 34925fa commit 6afa188
Show file tree
Hide file tree
Showing 7 changed files with 179 additions and 8 deletions.
76 changes: 76 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: infinispan-netcore-tests
env:
ISPN_VER: "11.0.9.Final"
CLIENT_VERSION: ${{ github.event.release.tag_name }}
on:
push:
tags:
- "*"
jobs:
run-ci-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
- run: echo $GITHUB_REF_NAME
- run: mkdir build && chmod a+rwx . documentation build
- run: podman build -t quay.io/rigazilla/ci-build-centos-7:latest -f ci-build/centos-7.Dockerfile .
- run: podman run -v `pwd`:/home/jboss/cpp-client quay.io/rigazilla/ci-build-centos-7:latest /bin/bash -c "cd cpp-client && INFINISPAN_VERSION=11.0.9.Final CLIENT_VERSION=$GITHUB_REF_NAME ./build.sh"
- uses: ncipollo/release-action@v1
with:
artifacts: "build/*.rpm,builddeb/*.deb"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
run-ci-tests-win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
- run: echo $GITHUB_REF_NAME
- name: Add msbuild to PATH
uses: microsoft/[email protected]
# with:
# vs-version: "[17.0,17.2)"
- name: Build Protobuf
shell: cmd
run: |
cd ${{ github.workspace }}
git clone -b v3.5.0 https://github.com/protocolbuffers/protobuf.git
mkdir libs
cd protobuf
mkdir build && cd build
cmake -G "Visual Studio 17 2022" -Dprotobuf_MSVC_STATIC_RUNTIME=OFF -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\libs -Dprotobuf_BUILD_TESTS=OFF ${{ github.workspace }}\protobuf\cmake
cmake --build . --config Release --target install
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/setup-python@v4
with:
python-version: "3.x" # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: "x64" # optional x64 or x86. Defaults to x64 if not specified
- shell: cmd
run: |
echo '::echo::on'
where swig
where mvn
where java
dir C:\ProgramData\Chocolatey\tools
set generator="Visual Studio 17 2022"
set SWIG_DIR=C:\ProgramData\Chocolatey\bin
set SWIG_EXECUTABLE=C:\ProgramData\Chocolatey\bin\swig.exe
set MVN_PROGRAM=C:\ProgramData\chocolatey\lib\maven\apache-maven-3.8.6\bin\mvn
set PROTOBUF_LIBRARY=${{ github.workspace }}\libs\lib\libprotobuf.lib
set PROTOBUF_PROTOC_EXECUTABLE=${{ github.workspace }}\libs\bin\protoc.exe
set PROTOBUF_PROTOC_LIBRARY=${{ github.workspace }}\libs\lib\libprotoc.lib
set PROTOBUF_INCLUDE_DIR=${{ github.workspace }}\libs\include
set INFINISPAN_VERSION=11.0.9.Final
set CLIENT_VERSION=%GITHUB_REF_NAME%
build.bat
- uses: ncipollo/release-action@v1
with:
artifacts: "build_win/*.zip"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
9 changes: 5 additions & 4 deletions build.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@echo on
if [%generator%] == [] call:usage generator
if [%JAVA_HOME%] == [] call:usage JAVA_HOME
if [%INFINISPAN_VERSION%] == [] call:usage INFINISPAN_VERSION
if [%SWIG_DIR%] == [] call:usage SWIG_DIR
if [%SWIG_EXECUTABLE%] == [] call:usage SWIG_EXECUTABLE
Expand All @@ -17,7 +17,7 @@ if not exist %JBOSS_HOME% (
)
"C:\Program Files\7-zip\7z.exe" x %JBOSS_ZIP%
)
copy test\data\*.* %JBOSS_HOME%\server\conf
copy test\data\*.* %JBOSS_HOME%\server\conf /y
xcopy /E /I /Y %JBOSS_HOME%\server %JBOSS_HOME%\server1\

call:do_build %generator%
Expand All @@ -27,7 +27,7 @@ goto:eof
setlocal
set build_dir=build_win

set PATH=%JAVA_HOME%\bin;%PATH%
rem set PATH=%JAVA_HOME%\bin;%PATH%
echo "Using JAVA_HOME=%JAVA_HOME%"

if exist %build_dir% rmdir %build_dir% /s /q
Expand All @@ -54,7 +54,7 @@ if 1%version_3micro% neq +1%version_3micro% set version_3micro=0

set version_patch=%version_3micro%.%version_4qualifier%

cmake -G "%~1" -DCPACK_PACKAGE_VERSION_MAJOR="%version_1major%" -DCPACK_PACKAGE_VERSION_MINOR="%version_2minor%" -DCPACK_PACKAGE_VERSION_PATCH="%version_patch%" -DSWIG_EXECUTABLE=%SWIG_EXECUTABLE% -DMVN_PROGRAM=%MVN_PROGRAM% -DPROTOBUF_LIBRARY="%PROTOBUF_LIBRARY%" -DPROTOBUF_PROTOC_LIBRARY="%PROTOBUF_PROTOC_LIBRARY%" -DPROTOBUF_INCLUDE_DIR="%PROTOBUF_INCLUDE_DIR%" -DPROTOBUF_PROTOC_EXECUTABLE="%PROTOBUF_PROTOC_EXECUTABLE%" -DOPENSSL_ROOT_DIR="%OPENSSL_ROOT_DIR%" ..
cmake -G "%~1" -DCPACK_PACKAGE_VERSION_MAJOR="%version_1major%" -DCPACK_PACKAGE_VERSION_MINOR="%version_2minor%" -DCPACK_PACKAGE_VERSION_PATCH="%version_patch%" -DSWIG_EXECUTABLE=%SWIG_EXECUTABLE% -DMVN_PROGRAM=%MVN_PROGRAM% -DPROTOBUF_LIBRARY="%PROTOBUF_LIBRARY%" -DPROTOBUF_PROTOC_LIBRARY="%PROTOBUF_PROTOC_LIBRARY%" -DProtobuf_INCLUDE_DIR="%PROTOBUF_INCLUDE_DIR%" -DPROTOBUF_INCLUDE_DIR="%PROTOBUF_INCLUDE_DIR%" -DPROTOBUF_PROTOC_EXECUTABLE="%PROTOBUF_PROTOC_EXECUTABLE%" -DOPENSSL_ROOT_DIR="%OPENSSL_ROOT_DIR%" ..
if %errorlevel% neq 0 goto fai

set home_drive=%CD:~0,2%
Expand Down Expand Up @@ -97,6 +97,7 @@ goto:eof

:fail
subst /D Y:
@echo off
echo "Failure!"
()
exit /b 1
Expand Down
3 changes: 1 addition & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ if [ "$INFINISPAN_VERSION" == "" ]
fi

BUILD_DIR=build

wget --progress=dot:giga -N http://downloads.jboss.org/infinispan/${INFINISPAN_VERSION}/infinispan-server-${INFINISPAN_VERSION}.zip

rm -rf infinispan-server-${INFINISPAN_VERSION}
Expand Down Expand Up @@ -77,7 +76,7 @@ else
echo cmake -DINSTALL_GTEST=OFF ${CMAKE_EXTRAS} .. &&
cmake -DINSTALL_GTEST=OFF ${CMAKE_EXTRAS} .. &&
cmake --build . &&
ctest -V &&
if [ "x$SKIP_TESTS" == "x" ]; then ctest -V ; fi &&
cpack -G RPM &&
cpack -C RelWithDebInfo --config CPackSourceConfig.cmake -G ZIP
fi
46 changes: 46 additions & 0 deletions ci-build/centos-7.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FROM quay.io/centos/centos:7

ENV JAVA_HOME=/usr/lib/jvm/java-11

RUN yum -y install 'dnf-command(config-manager)'
RUN yum -y update && \
yum -y install \
cmake \
cyrus-sasl-devel \
cyrus-sasl-plain \
cyrus-sasl-md5 \
cyrus-sasl-gssapi \
drpm \
iputils \
java-11-openjdk-devel \
krb5-workstation \
maven \
openssl-devel \
procps-ng \
protobuf \
protobuf-devel \
python3 \
rpmdevtools \
valgrind \
wget \
yum-utils \
gcc-c++ && \
yum -y install python3 && \
yum -y group install "Development Tools" && \
yum clean all && \
rm -rf /var/cache/yum

#RUN wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
#RUN yum -y install apache-maven


RUN groupadd -r jboss -g 1000 && useradd -u 1000 -r -g jboss -m -d /home/jboss -s /sbin/nologin -c "JBoss user" jboss && \
chmod 755 /home/jboss

# Set the working directory to jboss' user home directory
WORKDIR /home/jboss

# Specify the user which should be used to execute all commands below
USER jboss


45 changes: 45 additions & 0 deletions ci-build/centos-stream8.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
FROM quay.io/centos/centos:stream8

ENV JAVA_HOME=/usr/lib/jvm/java-11

RUN yum -y install 'dnf-command(config-manager)'
RUN yum config-manager --set-enabled powertools
RUN dnf -y update && \
dnf -y install \
cmake \
cyrus-sasl-devel \
cyrus-sasl-plain \
cyrus-sasl-md5 \
cyrus-sasl-gssapi \
drpm \
iputils \
java-11-openjdk-devel \
krb5-workstation \
maven \
openssl-devel \
procps-ng \
protobuf \
protobuf-devel \
python3 \
rpmdevtools \
valgrind \
wget \
yum-utils && \
dnf -y group install "Development Tools" && \
dnf clean all && \
rm -rf /var/cache/yum

#RUN wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
#RUN yum -y install apache-maven


RUN groupadd -r jboss -g 1000 && useradd -u 1000 -r -g jboss -m -d /home/jboss -s /sbin/nologin -c "JBoss user" jboss && \
chmod 755 /home/jboss

# Set the working directory to jboss' user home directory
WORKDIR /home/jboss

# Specify the user which should be used to execute all commands below
USER jboss


1 change: 1 addition & 0 deletions include/infinispan/hotrod/TransactionManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <memory>
#include <thread>
#include <map>
#include <string>
namespace infinispan {
namespace hotrod {

Expand Down
7 changes: 5 additions & 2 deletions test/bin/server_ctl.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,11 @@ def stop(args, verbose=False):

if jproc_pid is not None:
if os.name == 'nt' :
subprocess.call(["taskkill.exe", "/PID", str(jproc_pid), "/F", "/T"])
time.sleep(1)
try:
subprocess.call(["taskkill.exe", "/PID", str(jproc_pid), "/F", "/T"])
time.sleep(1)
except Exception:
pass
else:
try:
subprocess.call(["pkill", "-P", str(jproc_pid)])
Expand Down

0 comments on commit 6afa188

Please sign in to comment.