Skip to content

Commit 952e05e

Browse files
authored
Merge nightly + PR builder test GitHub Actions (#1243)
The nightly and PR builder test actions are largely identical, but duplicated. Changes: - Extract common jobs into shared `composite` workflows - e.g. a single shared Ubuntu x64 build+test action for PR builder _or_ nightly builds - Upgrade code coverage in PR builder to use `ubuntu-latest` as used elsewhere. Fixes: #1237
1 parent f30f684 commit 952e05e

File tree

12 files changed

+698
-629
lines changed

12 files changed

+698
-629
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Build & Test - macOS - x86-64
2+
3+
inputs:
4+
GH_TOKEN:
5+
required: true
6+
BOOST_VERSION:
7+
required: true
8+
WARN_AS_ERR:
9+
required: true
10+
BUILD_TYPE:
11+
required: true
12+
SHARED_LIBS_TOGGLE:
13+
required: true
14+
OPENSSL_TOGGLE:
15+
required: true
16+
RUN_TESTS:
17+
required: true
18+
HAZELCAST_ENTERPRISE_KEY:
19+
required: true
20+
AWS_ACCESS_KEY_ID:
21+
required: true
22+
AWS_SECRET_ACCESS_KEY:
23+
required: true
24+
HZ_TEST_AWS_INSTANCE_PRIVATE_IP:
25+
required: true
26+
27+
env:
28+
# Not possible to set this as a default
29+
# https://github.com/orgs/community/discussions/46670
30+
shell: bash
31+
32+
runs:
33+
using: composite
34+
steps:
35+
- name: Read Config
36+
shell: ${{ env.shell }}
37+
run: cat .github/config.env >> $GITHUB_ENV
38+
39+
- name: Install Dependencies
40+
shell: ${{ env.shell }}
41+
run: |
42+
sudo ./scripts/install-boost.sh ${{ inputs.BOOST_VERSION }}
43+
brew install [email protected] thrift curl
44+
45+
- name: Setup JDK
46+
uses: actions/setup-java@v4
47+
with:
48+
java-version: ${{ env.JAVA_VERSION }}
49+
distribution: ${{ env.JAVA_DISTRIBUTION }}
50+
51+
- uses: ./.github/actions/build-test/unix
52+
with:
53+
GH_TOKEN: ${{ inputs.GH_TOKEN }}
54+
BOOST_VERSION: ${{ inputs.BOOST_VERSION }}
55+
THRIFT_VERSION: ${{ inputs.THRIFT_VERSION }}
56+
WARN_AS_ERR: ${{ inputs.WARN_AS_ERR }}
57+
BUILD_TYPE: ${{ inputs.BUILD_TYPE }}
58+
SHARED_LIBS_TOGGLE: ${{ inputs.SHARED_LIBS_TOGGLE }}
59+
OPENSSL_TOGGLE: ${{ inputs.OPENSSL_TOGGLE }}
60+
RUN_TESTS: ${{ inputs.RUN_TESTS }}
61+
HAZELCAST_ENTERPRISE_KEY: ${{ inputs.HAZELCAST_ENTERPRISE_KEY }}
62+
AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }}
63+
AWS_SECRET_ACCESS_KEY: ${{ inputs.AWS_SECRET_ACCESS_KEY }}
64+
HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ inputs.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }}
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Build & Test - Ubuntu - i386
2+
3+
inputs:
4+
GH_TOKEN:
5+
required: true
6+
BOOST_VERSION:
7+
required: true
8+
THRIFT_VERSION:
9+
required: true
10+
WARN_AS_ERR:
11+
required: true
12+
BUILD_TYPE:
13+
required: true
14+
SHARED_LIBS_TOGGLE:
15+
required: true
16+
OPENSSL_TOGGLE:
17+
required: true
18+
RUN_TESTS:
19+
required: true
20+
HAZELCAST_ENTERPRISE_KEY:
21+
required: true
22+
AWS_ACCESS_KEY_ID:
23+
required: true
24+
AWS_SECRET_ACCESS_KEY:
25+
required: true
26+
HZ_TEST_AWS_INSTANCE_PRIVATE_IP:
27+
required: true
28+
29+
env:
30+
# Not possible to set this as a default
31+
# https://github.com/orgs/community/discussions/46670
32+
shell: bash
33+
34+
runs:
35+
using: composite
36+
steps:
37+
- name: Read Config
38+
shell: ${{ env.shell }}
39+
run: cat .github/config.env >> $GITHUB_ENV
40+
41+
# Install Java via `apt`, can't use the `setup-java` action on this image
42+
# `setup-java` is written in TypeScript and requires a compatible Node installation
43+
# Newest available version for this image is Node 8, which is too old for any version to run against
44+
# https://github.com/actions/setup-node/issues/922
45+
- name: Install Necessary Packages
46+
shell: ${{ env.shell }}
47+
run: |
48+
apt-get update
49+
apt-get install -y build-essential cmake curl git libssl-dev maven net-tools openjdk-${{ env.JAVA_VERSION }}-jre-headless gdb curl
50+
51+
- name: Make sure the target architecture is 32 bit
52+
shell: ${{ env.shell }}
53+
run: |
54+
echo 'int main() { return sizeof(void*) != 4; }' > test.c
55+
gcc test.c -oa
56+
./a
57+
rm a test.c
58+
59+
# `apt-get` brings in `3.6` which is too old to be compatible with Java 17
60+
- name: Install Maven
61+
shell: ${{ env.shell }}
62+
run: |
63+
install_dir="/opt/maven"
64+
mkdir ${install_dir}
65+
curl \
66+
--fail \
67+
--silent \
68+
--show-error \
69+
--location \
70+
https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/${{ env.MAVEN_VERSION }}/apache-maven-${{ env.MAVEN_VERSION }}-bin.tar.gz |
71+
tar \
72+
--extract \
73+
--gzip \
74+
--strip-components=1 \
75+
--directory ${install_dir}
76+
echo "${install_dir}/bin" >> $GITHUB_PATH
77+
78+
- name: Install Boost
79+
shell: ${{ env.shell }}
80+
run: |
81+
./scripts/install-boost.sh ${{ inputs.BOOST_VERSION }}
82+
83+
- name: Install Thrift
84+
shell: ${{ env.shell }}
85+
run: |
86+
./scripts/install-thrift.sh ${{ inputs.THRIFT_VERSION }}
87+
88+
- name: Configure Resources
89+
if: ${{ inputs.run_tests }}
90+
shell: ${{ env.shell }}
91+
run: |
92+
ulimit -c unlimited
93+
94+
sh -c "echo 'core' > /proc/sys/kernel/core_pattern"
95+
sh -c "echo '1' > /proc/sys/kernel/core_uses_pid"
96+
97+
- uses: ./.github/actions/build-test/unix
98+
with:
99+
GH_TOKEN: ${{ inputs.GH_TOKEN }}
100+
BOOST_VERSION: ${{ inputs.BOOST_VERSION }}
101+
THRIFT_VERSION: ${{ inputs.THRIFT_VERSION }}
102+
WARN_AS_ERR: ${{ inputs.WARN_AS_ERR }}
103+
BUILD_TYPE: ${{ inputs.BUILD_TYPE }}
104+
SHARED_LIBS_TOGGLE: ${{ inputs.SHARED_LIBS_TOGGLE }}
105+
OPENSSL_TOGGLE: ${{ inputs.OPENSSL_TOGGLE }}
106+
RUN_TESTS: ${{ inputs.RUN_TESTS }}
107+
HAZELCAST_ENTERPRISE_KEY: ${{ inputs.HAZELCAST_ENTERPRISE_KEY }}
108+
AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }}
109+
AWS_SECRET_ACCESS_KEY: ${{ inputs.AWS_SECRET_ACCESS_KEY }}
110+
HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ inputs.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Build & Test - Ubuntu - x86-64
2+
3+
inputs:
4+
GH_TOKEN:
5+
required: true
6+
BOOST_VERSION:
7+
required: true
8+
THRIFT_VERSION:
9+
required: true
10+
WARN_AS_ERR:
11+
required: true
12+
BUILD_TYPE:
13+
required: true
14+
SHARED_LIBS_TOGGLE:
15+
required: true
16+
OPENSSL_TOGGLE:
17+
required: true
18+
RUN_TESTS:
19+
required: true
20+
HAZELCAST_ENTERPRISE_KEY:
21+
required: true
22+
AWS_ACCESS_KEY_ID:
23+
required: true
24+
AWS_SECRET_ACCESS_KEY:
25+
required: true
26+
HZ_TEST_AWS_INSTANCE_PRIVATE_IP:
27+
required: true
28+
29+
env:
30+
# Not possible to set this as a default
31+
# https://github.com/orgs/community/discussions/46670
32+
shell: bash
33+
34+
runs:
35+
using: composite
36+
steps:
37+
- name: Install Necessary Packages
38+
shell: ${{ env.shell }}
39+
run: |
40+
sudo apt-get update
41+
sudo apt-get install -y net-tools libssl-dev gdb curl
42+
43+
- name: Read Config
44+
shell: ${{ env.shell }}
45+
run: cat .github/config.env >> $GITHUB_ENV
46+
47+
- name: Setup JDK
48+
uses: actions/setup-java@v4
49+
with:
50+
java-version: ${{ env.JAVA_VERSION }}
51+
distribution: ${{ env.JAVA_DISTRIBUTION }}
52+
53+
- name: Install Boost
54+
shell: ${{ env.shell }}
55+
run: |
56+
sudo ./scripts/install-boost.sh ${{ inputs.BOOST_VERSION }}
57+
58+
- name: Install Thrift
59+
shell: ${{ env.shell }}
60+
run: |
61+
sudo ./scripts/install-thrift.sh ${{ inputs.THRIFT_VERSION }}
62+
63+
- name: Configure Resources
64+
if: ${{ inputs.run_tests }}
65+
shell: ${{ env.shell }}
66+
run: |
67+
ulimit -c unlimited
68+
69+
sudo sh -c "echo 'core' > /proc/sys/kernel/core_pattern"
70+
sudo sh -c "echo '1' > /proc/sys/kernel/core_uses_pid"
71+
72+
- uses: ./.github/actions/build-test/unix
73+
with:
74+
GH_TOKEN: ${{ inputs.GH_TOKEN }}
75+
BOOST_VERSION: ${{ inputs.BOOST_VERSION }}
76+
THRIFT_VERSION: ${{ inputs.THRIFT_VERSION }}
77+
WARN_AS_ERR: ${{ inputs.WARN_AS_ERR }}
78+
BUILD_TYPE: ${{ inputs.BUILD_TYPE }}
79+
SHARED_LIBS_TOGGLE: ${{ inputs.SHARED_LIBS_TOGGLE }}
80+
OPENSSL_TOGGLE: ${{ inputs.OPENSSL_TOGGLE }}
81+
RUN_TESTS: ${{ inputs.RUN_TESTS }}
82+
HAZELCAST_ENTERPRISE_KEY: ${{ inputs.HAZELCAST_ENTERPRISE_KEY }}
83+
AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }}
84+
AWS_SECRET_ACCESS_KEY: ${{ inputs.AWS_SECRET_ACCESS_KEY }}
85+
HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ inputs.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Build & Test - Unix
2+
3+
inputs:
4+
GH_TOKEN:
5+
required: true
6+
BOOST_VERSION:
7+
required: true
8+
THRIFT_VERSION:
9+
required: true
10+
WARN_AS_ERR:
11+
required: true
12+
BUILD_TYPE:
13+
required: true
14+
SHARED_LIBS_TOGGLE:
15+
required: true
16+
OPENSSL_TOGGLE:
17+
required: true
18+
RUN_TESTS:
19+
required: true
20+
HAZELCAST_ENTERPRISE_KEY:
21+
required: true
22+
AWS_ACCESS_KEY_ID:
23+
required: true
24+
AWS_SECRET_ACCESS_KEY:
25+
required: true
26+
HZ_TEST_AWS_INSTANCE_PRIVATE_IP:
27+
required: true
28+
29+
env:
30+
# Not possible to set this as a default
31+
# https://github.com/orgs/community/discussions/46670
32+
shell: bash
33+
34+
runs:
35+
using: composite
36+
steps:
37+
- name: Download hazelcast-enterprise-tests.jar
38+
shell: ${{ env.shell }}
39+
run: |
40+
curl -H "Authorization: token ${{ inputs.GH_TOKEN }}" https://raw.githubusercontent.com/hazelcast/private-test-artifacts/data/certs.jar > hazelcast-enterprise-${{ env.HAZELCAST_VERSION }}-tests.jar
41+
42+
- name: Build & Install
43+
env:
44+
BUILD_DIR: build
45+
INSTALL: ON
46+
WARN_AS_ERR: ${{ inputs.WARN_AS_ERR }}
47+
shell: ${{ env.shell }}
48+
run: |
49+
./scripts/build-unix.sh \
50+
-DCMAKE_BUILD_TYPE=${{ inputs.BUILD_TYPE }} \
51+
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/destination \
52+
-DBUILD_SHARED_LIBS=${{ inputs.SHARED_LIBS_TOGGLE }} \
53+
-DWITH_OPENSSL=${{ inputs.OPENSSL_TOGGLE }} \
54+
-DBUILD_TESTS=ON \
55+
-DBUILD_EXAMPLES=OFF
56+
57+
- name: Test
58+
if: ${{ inputs.run_tests }}
59+
env:
60+
BUILD_DIR: build
61+
HAZELCAST_ENTERPRISE_KEY: ${{ inputs.HAZELCAST_ENTERPRISE_KEY }}
62+
AWS_ACCESS_KEY_ID: ${{ inputs.AWS_ACCESS_KEY_ID }}
63+
AWS_SECRET_ACCESS_KEY: ${{ inputs.AWS_SECRET_ACCESS_KEY }}
64+
HZ_TEST_AWS_INSTANCE_PRIVATE_IP: ${{ inputs.HZ_TEST_AWS_INSTANCE_PRIVATE_IP }}
65+
shell: ${{ env.shell }}
66+
run: |
67+
./scripts/test-unix.sh

0 commit comments

Comments
 (0)