Skip to content

update opendnp3

update opendnp3 #570

Workflow file for this run

name: opendatacon workflow
on:
push:
branches:
- '**' # matches every branch
tags:
- '[0-9]+.[0-9]+.[0-9]+*'
pull_request:
branches:
- '**'
jobs:
opendatacon-dockerfile-builds:
name: ${{matrix.name}}
strategy:
fail-fast: false
matrix:
include:
- name: Debian 12 Bookworm Release
run-os: ubuntu-latest
docker-file: Debian12Bookworm
build-type: Release
docker-args:
- name: Debian 12 Bookworm Debug
run-os: ubuntu-latest
docker-file: Debian12Bookworm
build-type: Debug
docker-args:
- name: Debian 12 Bookworm 32bit Release
run-os: ubuntu-latest
docker-file: Debian12Bookworm
build-type: Release
docker-args: --build-arg DOCKER_ARCH='i386/' --build-arg CMAKE_OPTIONS='-DARCH_DESC=x86'
- name: Debian 12 Bookworm 32bit Debug
run-os: ubuntu-latest
docker-file: Debian12Bookworm
build-type: Debug
docker-args: --build-arg DOCKER_ARCH='i386/' --build-arg CMAKE_OPTIONS='-DARCH_DESC=x86'
- name: Oracle Enterprise Linux 7 Release
run-os: ubuntu-latest
docker-file: OEL7
build-type: Release
docker-args:
- name: Oracle Enterprise Linux 7 Debug
run-os: ubuntu-latest
docker-file: OEL7
build-type: Debug
docker-args:
- name: Redhat Enterprise Linux 9 Release
run-os: ubuntu-latest
docker-file: RHEL9
build-type: Release
docker-args:
- name: Redhat Enterprise Linux 9 Debug
run-os: ubuntu-latest
docker-file: RHEL9
build-type: Debug
docker-args:
runs-on: ${{ matrix.run-os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Upload release text
run: git tag -l --format='%(contents)' $(git describe) > tag_annotation.txt
- name: Run Setup Commands
run: ${{ matrix.setup-cmds }}
- name: Dockerfile Build
run: |
docker build \
--build-arg BUILD_TYPE=${{ matrix.build-type }} \
--build-arg BUILD_COMMIT=${{ github.sha }} \
${{ matrix.docker-args }} \
--output type=local,dest=./ \
-t opendatacon-builder -f DockerFiles/${{ matrix.docker-file }} .
- name: Upload Installer
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }} Installer
retention-days: 7
path: |
opendatacon-*.sh
opendatacon-*.exe
tag_annotation.txt
- name: Upload Logs
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.run-os }} Logs
retention-days: 7
path: |
ODC_Log*
opendatacon-native:
name: ${{matrix.os}} ${{matrix.build-type}} ${{matrix.bits}}
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
build-type: [Release,Debug]
bits: [64]
include:
- os: windows-latest
build-type: Release
bits: 32
cross: 'none'
- os: windows-latest
build-type: Debug
bits: 32
cross: 'none'
runs-on: ${{ matrix.os }}
env:
BUILD_TYPE: ${{ matrix.build-type }}
INSTALL_PREFIX: ${{github.workspace}}/build/install
JOB_NAME: ${{matrix.os}}_${{matrix.build-type}}_${{matrix.bits}}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- if: matrix.bits == 32 && contains(matrix.os,'windows') #FIXME: openssl version pinned to 1.1.1 because 3.x choco doesn't support 32bit
name: Set 32-bit env
run: |
echo 'BITPLAT=x86' >> $env:GITHUB_ENV
echo 'BITGEN=-AWin32' >> $env:GITHUB_ENV
choco install openssl --version=1.1.1.2100 --x86
Remove-Item 'C:\hostedtoolcache\windows\Python\3.7.9\x64' -Recurse
echo "C:\hostedtoolcache\windows\Python\3.7.9\x86" >> $env:GITHUB_PATH
Copy-Item -Path ${{github.workspace}}/Code/Ports/PyPort/x86/python37_d.dll -Destination C:\Windows\sysWOW64\
- if: matrix.bits == 64 && contains(matrix.os,'windows')
name: Set 64-bit env
run: |
echo 'BITPLAT=x64' >> $env:GITHUB_ENV
echo 'BITGEN=-Ax64' >> $env:GITHUB_ENV
choco install openssl
Copy-Item -Path ${{github.workspace}}/Code/Ports/PyPort/x64/python37_d.dll -Destination C:\Windows\system32\
- if: contains(matrix.os,'windows')
name: Setup Windows Environment
run: |
If (-not (Test-Path C:\libmodbus\libmodbus)){
Invoke-WebRequest -OutFile libmodbus.zip "https://www.dropbox.com/s/iqf95y9x1x4ol36/libmodbus.zip?dl=1"
7z x -y libmodbus.zip
New-Item C:\libmodbus -ItemType Directory
Move-Item .\libmodbus C:\libmodbus\libmodbus
}
#hack because debug lib aint available!
Copy-Item -Path ${{github.workspace}}/Code/Ports/PyPort/${{env.BITPLAT}}/python37_d.lib -Destination C:/hostedtoolcache/windows/Python/3.7.9/${{env.BITPLAT}}/libs/
echo 'TOOLCHAIN_OPT=-G"Visual Studio 17 2022" ${{env.BITGEN}} -DCMAKE_CONFIGURATION_TYPES=${{env.BUILD_TYPE}} -DMODBUS_HOME=c:\libmodbus\libmodbus\windows${{matrix.bits}} -DPYTHON_HOME=C:\hostedtoolcache\windows\Python\3.7.9\${{env.BITPLAT}}' >> $env:GITHUB_ENV
- if: contains(matrix.os,'macos')
name: Setup MacOS Environment
run: |
brew install libmodbus socat
echo 'TOOLCHAIN_OPT=-DPACKAGE_DNP3=OFF -DPACKAGE_LIBMODBUS=OFF -DPACKAGE_PYTHON=OFF -DPACKAGE_DNP3=OFF -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl@3 -DPYTHON_HOME=/opt -DMODBUS_HOME=/opt/homebrew' >> $GITHUB_ENV
echo 'BINDIR=bin/' >> $GITHUB_ENV
- name: Upload release text
run: git tag -l --format='%(contents)' $(git describe) > tag_annotation.txt
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{env.INSTALL_PREFIX}} ${{env.TOOLCHAIN_OPT}} ${{env.SYSVER_OPT}} -DFULL=ON
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel 8
- name: Package
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target package
- name: Install
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target install
- name: ODC_tests
if: ${{ always() && !contains(github.ref, 'tag') }}
run: ${{github.workspace}}/build/install/${{env.BINDIR}}ODC_tests ${{env.LOG_LVL}} -d yes
- name: libLua_tests
if: ${{ always() && !contains(github.ref, 'tag') }}
run: ${{github.workspace}}/build/install/${{env.BINDIR}}libLua_tests ${{env.LOG_LVL}} -d yes
- name: DNP3Port_tests
if: ${{ always() && !contains(github.ref, 'tag') }}
run: ${{github.workspace}}/build/install/${{env.BINDIR}}DNP3Port_tests ${{env.LOG_LVL}} -d yes
- name: SimPort_tests
if: ${{ always() && !contains(github.ref, 'tag') }}
run: ${{github.workspace}}/build/install/${{env.BINDIR}}SimPort_tests -d yes
- name: MD3Port_tests
if: ${{ always() && !contains(github.ref, 'tag') }}
run: ${{github.workspace}}/build/install/${{env.BINDIR}}MD3Port_tests ${{env.LOG_LVL}} -d yes
- name: CBPort_tests
if: ${{ always() && !contains(github.ref, 'tag') }}
run: ${{github.workspace}}/build/install/${{env.BINDIR}}CBPort_tests ${{env.LOG_LVL}} -d yes
- name: PyPort_tests
if: ${{ always() && !contains(github.ref, 'tag') }}
run: ${{github.workspace}}/build/install/${{env.BINDIR}}PyPort_tests ${{env.LOG_LVL}} -d yes
- name: FileTransferPort_tests
if: ${{ always() && !contains(github.ref, 'tag') }}
run: ${{github.workspace}}/build/install/${{env.BINDIR}}FileTransferPort_tests ${{env.LOG_LVL}} -d yes
- name: LuaPort_tests
if: ${{ always() && !contains(github.ref, 'tag') }}
run: ${{github.workspace}}/build/install/${{env.BINDIR}}LuaPort_tests ${{env.LOG_LVL}} -d yes
- name: Integration_tests
if: ${{ always() && !contains(github.ref, 'tag') }}
run: ${{github.workspace}}/build/install/${{env.BINDIR}}Integration_tests ${{env.LOG_LVL}} -d yes
- name: Upload Installer
uses: actions/upload-artifact@v4
with:
name: ${{env.JOB_NAME}} Installer
retention-days: 7
path: |
build/opendatacon-*.sh
build/opendatacon-*.exe
tag_annotation.txt
- name: Upload Logs
uses: actions/upload-artifact@v4
with:
name: ${{env.JOB_NAME}} Logs
retention-days: 7
path: |
ODC_Log*
opendatacon-deploy:
if: always() && contains(github.ref, 'tag')
needs: [opendatacon-native,opendatacon-dockerfile-builds]
runs-on: macos-latest
steps:
- name: Download Installers
uses: actions/download-artifact@v4
with:
path: installers
pattern: '*Installer'
merge-multiple: true
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: false
body_path: installers/tag_annotation.txt
files: |
**/opendatacon-*.*.*-*-*-*-*-*.sh
**/opendatacon-*.*.*-*-*-*-*-*.exe
fail_on_unmatched_files: false
token: ${{ secrets.GITHUB_TOKEN }}
opendatacon-clean:
if: github.event_name != 'pull_request'
needs: [opendatacon-native,opendatacon-dockerfile-builds]
runs-on: ubuntu-latest
steps:
- name: Remove old artifacts
uses: c-hive/gha-remove-artifacts@v1
with:
age: '1 week'
skip-recent: 5
skip-tags: false