Skip to content

Commit

Permalink
add separate open62541 github action
Browse files Browse the repository at this point in the history
  • Loading branch information
cochicde committed Sep 16, 2024
1 parent 5c663ac commit 539b6f7
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/actions/opc_ua/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Clone and compile open62541
author: Jose Cabral
Description: "Clone open62541 and build a release static library with discovery multicast and events"

inputs:
git_version:
type: string
Decription: Version of open62541 to clone
required: True

cpp_compiler:
type: string
Description: C++ compiler to use, passed as CMAKE_CXX_COMPILER to CMake
required: True

c_compiler:
type: string
Description: C compiler to use, passed as CMAKE_C_COMPILER to CMake
required: True

outputs:
opc_ua-include:
value: ${{ steps.vars.outputs.opc_ua-include }}
description: The include directory
opc_ua-lib-dir:
value: ${{ steps.vars.outputs.opc_ua-lib-dir }}
description: The library directory

runs:
using: "composite"
steps:
- name: Clone open62541
shell: bash
run: |
git clone https://github.com/open62541/open62541 -b ${{ inputs.git_version }}
cd open62541
git submodule update --recursive --init
- name: Build open62541
shell: bash
run: |
cd open62541
cmake \
-B static \
-DCMAKE_CXX_COMPILER=${{ inputs.cpp_compiler }} \
-DCMAKE_C_COMPILER=${{ inputs.c_compiler }} \
-DCMAKE_BUILD_TYPE=Release \
-DUA_ENABLE_AMALGAMATION=ON \
-DUA_ENABLE_DISCOVERY=ON \
-DUA_ENABLE_DISCOVERY_MULTICAST=ON \
-DUA_ENABLE_SUBSCRIPTIONS_EVENTS=ON \
-DUA_FORCE_WERROR=OFF \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF
cmake --build static
- name: Output variables
id: vars
shell: bash
run: |
echo "opc_ua-include=${{ github.workspace }}/open62541/static" >> "$GITHUB_OUTPUT"
echo "opc_ua-lib-dir=${{ github.workspace }}/open62541/static/bin" >> "$GITHUB_OUTPUT"
12 changes: 12 additions & 0 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ jobs:
if: ${{ matrix.os == 'windows-latest' }}
run: nuget install boost -Version 1.84.0

- name: clone and build open62541
id: open62541
uses: ./.github/actions/opc_ua
with:
git_version: v1.3.9
cpp_compiler: ${{ matrix.cpp_compiler }}
c_compiler: ${{ matrix.c_compiler }}

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
Expand All @@ -80,6 +88,10 @@ jobs:
-DFORTE_COM_FBDK=ON
-DFORTE_COM_HTTP=ON
-DFORTE_COM_LOCAL=ON
-DFORTE_COM_OPC_UA=ON
-DFORTE_COM_OPC_UA_INCLUDE_DIR=${{ steps.open62541.outputs.opc_ua-include }}
-DFORTE_COM_OPC_UA_LIB_DIR=${{ steps.open62541.outputs.opc_ua-lib-dir }}/${{ matrix.os == 'windows-latest' && matrix.build_type || '' }}
-DFORTE_COM_OPC_UA_MULTICAST=ON
-DFORTE_COM_RAW=ON
-DFORTE_COM_SER=ON
-DFORTE_COM_STRUCT_MEMBER=ON
Expand Down

0 comments on commit 539b6f7

Please sign in to comment.