Skip to content

Commit 3737b07

Browse files
committed
CI using OpenDDS
1 parent 0be3bcc commit 3737b07

File tree

1 file changed

+119
-0
lines changed

1 file changed

+119
-0
lines changed

.github/workflows/ci_opendds.yml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: CI OpenDDS
2+
on:
3+
pull_request:
4+
push:
5+
schedule:
6+
- cron: '10 0 * * 0'
7+
workflow_dispatch:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build:
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
dds:
19+
- opendds
20+
runner:
21+
- ubuntu-24.04
22+
23+
runs-on: ${{ matrix.runner }}
24+
25+
steps:
26+
- name: 'Checkout dds-rtps'
27+
uses: actions/checkout@v4
28+
- name: 'Checkout MPC'
29+
uses: actions/checkout@v4
30+
with:
31+
repository: DOCGroup/MPC
32+
path: MPC
33+
fetch-depth: 1
34+
- name: 'Checkout ACE_TAO'
35+
uses: actions/checkout@v4
36+
with:
37+
repository: DOCGroup/ACE_TAO
38+
ref: ace6tao2
39+
path: ACE_TAO
40+
fetch-depth: 1
41+
- name: 'Checkout OpenDDS'
42+
uses: actions/checkout@v4
43+
with:
44+
repository: OpenDDS/OpenDDS
45+
ref: latest-release
46+
path: OpenDDS
47+
fetch-depth: 1
48+
- name: 'Set environment variables'
49+
shell: bash
50+
run: |-
51+
echo "ACE_ROOT=$GITHUB_WORKSPACE/ACE_TAO/ACE" >> $GITHUB_ENV
52+
echo "TAO_ROOT=$GITHUB_WORKSPACE/ACE_TAO/TAO" >> $GITHUB_ENV
53+
echo "DDS_ROOT=$GITHUB_WORKSPACE/OpenDDS" >> $GITHUB_ENV
54+
echo "MPC_ROOT=$GITHUB_WORKSPACE/MPC" >> $GITHUB_ENV
55+
export COMPILER_VERSION=$(c++ --version 2>&1 | head -n 1)
56+
echo "COMPILER_VERSION=$COMPILER_VERSION" >> $GITHUB_ENV
57+
echo "OBJ_EXT=\\.o" >> $GITHUB_ENV
58+
cd ACE_TAO
59+
export ACE_COMMIT=$(git rev-parse HEAD)
60+
echo "ACE_COMMIT=$ACE_COMMIT" >> $GITHUB_ENV
61+
cd ../OpenDDS
62+
export DDS_COMMIT=$(git rev-parse HEAD)
63+
echo "DDS_COMMIT=$DDS_COMMIT" >> $GITHUB_ENV
64+
export MATRIX_MD5=$(echo "${{ matrix }}" | md5sum | cut -d ' ' -f 1)
65+
echo "MATRIX_MD5=$MATRIX_MD5" >> $GITHUB_ENV
66+
export COMPILER_MD5=$(echo "$COMPILER_VERSION" | md5sum | cut -d ' ' -f 1)
67+
echo "COMPILER_MD5=$COMPILER_MD5" >> $GITHUB_ENV
68+
export CONFIG_OPTIONS="--optimize --no-debug --static --no-inline"
69+
echo "CONFIG_OPTIONS=$CONFIG_OPTIONS" >> $GITHUB_ENV
70+
export CONFIG_MD5=$(echo "$CONFIG_OPTIONS" | md5sum | cut -d ' ' -f 1)
71+
echo "CONFIG_MD5=$CONFIG_MD5" >> $GITHUB_ENV
72+
- name: 'Check Build Cache'
73+
id: cache-build
74+
uses: actions/cache@v4
75+
with:
76+
path: ${{ env.MATRIX_MD5 }}.tar.xz
77+
key: c01_${{ env.MATRIX_MD5 }}_${{ env.COMPILER_MD5 }}_${{ env.ACE_COMMIT }}_${{ env.DDS_COMMIT }}_${{ env.CONFIG_MD5 }}
78+
- name: 'Extract Build Cache'
79+
if: steps.cache-build.outputs.cache-hit == 'true'
80+
shell: bash
81+
run: |
82+
tar xvfJ ${{ env.MATRIX_MD5 }}.tar.xz
83+
- name: 'Configure OpenDDS'
84+
if: steps.cache-build.outputs.cache-hit != 'true'
85+
shell: bash
86+
run: |-
87+
cd OpenDDS
88+
./configure ${{ env.CONFIG_OPTIONS }}
89+
tools/scripts/show_build_config.pl
90+
- name: 'Build OpenDDS'
91+
if: steps.cache-build.outputs.cache-hit != 'true'
92+
shell: bash
93+
run: |-
94+
cd OpenDDS
95+
. setenv.sh
96+
make -j3 OpenDDS_Rtps_Udp
97+
- name: 'Create Build Cache'
98+
if: steps.cache-build.outputs.cache-hit != 'true'
99+
shell: bash
100+
run: |
101+
cd ACE_TAO
102+
find . -iname "*$OBJ_EXT" | xargs rm
103+
git clean -xdn | cut -d ' ' -f 3- | sed 's/^/ACE_TAO\//g' | tee ../ACE_TAO_files.txt
104+
cd ..
105+
tar cvf ${{ env.MATRIX_MD5 }}.tar ACE_TAO/ACE/ace/config.h
106+
cat ACE_TAO_files.txt | xargs tar uvf ${{ env.MATRIX_MD5 }}.tar
107+
cd OpenDDS
108+
find . -iname "*$OBJ_EXT" | xargs rm
109+
git clean -xdn | cut -d ' ' -f 3- | sed 's/^/OpenDDS\//g' | tee ../OpenDDS_files.txt
110+
cd ..
111+
cat OpenDDS_files.txt | xargs tar uvf ${{ env.MATRIX_MD5 }}.tar
112+
xz -3 ${{ env.MATRIX_MD5 }}.tar
113+
- name: 'Set Up Problem Matcher'
114+
uses: ammaraskar/[email protected]
115+
- name: 'Build Application'
116+
shell: bash
117+
run: |-
118+
cmake -G Ninja -S srcCxx/opendds-cmake -B build -D OpenDDS_ROOT=OpenDDS
119+
cmake --build build

0 commit comments

Comments
 (0)