diff --git a/.github/actions/opc_ua/action.yml b/.github/actions/opc_ua/action.yml new file mode 100644 index 00000000..8f31ec4c --- /dev/null +++ b/.github/actions/opc_ua/action.yml @@ -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" diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index b0582318..cba04f02 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -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 @@ -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