Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/actions/assert-opendaq-installed/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: 'Assert openDAQ Installed'
description: 'Verify that openDAQ package is installed on the system'

inputs:
enable-32bit:
description: 'Check for 32-bit installation on Windows'
required: false
default: false

runs:
using: composite
steps:
- name: Verify Installation (Linux)
if: runner.os == 'Linux'
shell: bash
run: |
if ! dpkg-query -W -f='${Status}' opendaq 2>/dev/null | grep -qx "install ok installed"; then
echo "::error::✗ Package not installed or in invalid state"
exit 1
fi

- name: Verify Installation (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
if ("${{ inputs.enable-32bit }}" -eq "true") {
$installPath = "C:\Program Files (x86)\openDAQ"
$binPath = "C:\Program Files (x86)\openDAQ\bin"
} else {
$installPath = "C:\Program Files\openDAQ"
$binPath = "C:\Program Files\openDAQ\bin"
}

# Assert installation directory exists
if (-not (Test-Path $installPath)) {
Write-Host "::error::✗ Installation directory not found: $installPath"
exit 1
}

# Assert bin directory is in PATH
if ($env:PATH -notlike "*$binPath*") {
Write-Host "::error::✗ PATH does not contain: $binPath"
exit 1
}
63 changes: 63 additions & 0 deletions .github/actions/assert-opendaq-version-equals/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: 'Assert openDAQ Version Equals'
description: 'Verify that installed openDAQ version matches expected version'

inputs:
expected-version:
description: 'Expected version (with v prefix and optional suffix like v3.30.0-rc)'
required: true
enable-32bit:
description: 'Check 32-bit installation on Windows'
required: false
default: false

runs:
using: composite
steps:
- name: Verify Version (Linux)
if: runner.os == 'Linux'
shell: bash
run: |
ACTUAL_VERSION=$(dpkg-query -W -f='${Version}' opendaq)
EXPECTED_VERSION="${{ inputs.expected-version }}"
EXPECTED_VERSION="${EXPECTED_VERSION#v}"
EXPECTED_VERSION="${EXPECTED_VERSION%%-*}"

if [[ "$ACTUAL_VERSION" != "$EXPECTED_VERSION"* ]]; then
echo "::error::✗ Version mismatch: expected <$EXPECTED_VERSION> but was <$ACTUAL_VERSION>"
exit 1
fi

- name: Verify Version (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
if ("${{ inputs.enable-32bit }}" -eq "true") {
$binDir = "C:\Program Files (x86)\openDAQ\bin"
$dllPath = "$binDir\opendaq-32-3.dll"
} else {
$binDir = "C:\Program Files\openDAQ\bin"
$dllPath = "$binDir\opendaq-64-3.dll"
}

if (-not (Test-Path $binDir)) {
Write-Host "::error::✗ Directory not found: $binDir"
exit 1
}

if (-not (Test-Path $dllPath)) {
Write-Host "::error::✗ DLL not found: $dllPath"
Write-Host "Directory contents:"
Get-ChildItem $binDir | ForEach-Object { Write-Host " $_" }
exit 1
}

$actualVersion = (Get-Item $dllPath).VersionInfo.FileVersion
$expectedVersion = "${{ inputs.expected-version }}" -replace '^v', '' -replace '-.*$', ''

# FileVersion is like 3.31.0.0, compare first 3 components
$actualMajorMinorPatch = ($actualVersion -split '\.')[0..2] -join '.'

if ($actualMajorMinorPatch -ne $expectedVersion) {
Write-Host "::error::✗ Version mismatch: expected <$expectedVersion> but was <$actualMajorMinorPatch>"
exit 1
}
46 changes: 0 additions & 46 deletions .github/workflows/README.md

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/test-all-actions.yml

This file was deleted.

208 changes: 208 additions & 0 deletions .github/workflows/test-install-framework.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
name: Test Install Framework Action

on:
pull_request:
paths:
- 'install-framework/**'
- '.github/workflows/test-install-framework.yml'
push:
branches: [ main ]
paths:
- 'install-framework/**'
- '.github/workflows/test-install-framework.yml'
workflow_dispatch:

jobs:
ubuntu-autodetect:
name: Ubuntu Autodetect (${{ matrix.runner }})
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
runner:
- ubuntu-22.04
- ubuntu-22.04-arm
- ubuntu-24.04
- ubuntu-24.04-arm
- ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Framework (default version)
id: install
uses: ./install-framework

- name: Verify Installation
uses: ./.github/actions/assert-opendaq-installed

ubuntu-versions-explicit:
name: Ubuntu ${{ matrix.version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 1
matrix:
version:
- v3.30.0
- v3.29.0-rc
- v3.20.4
- v3.19.4-rc
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Framework
id: install
uses: ./install-framework
with:
version: ${{ matrix.version }}

- name: Verify Framework Installed
uses: ./.github/actions/assert-opendaq-installed

- name: Verify Framework Version
uses: ./.github/actions/assert-opendaq-version-equals
with:
expected-version: ${{ matrix.version }}

ubuntu-versions-aliased:
name: Ubuntu ${{ matrix.version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
- latest
- latest-stable
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Framework
id: install
uses: ./install-framework
with:
version: ${{ matrix.version }}

- name: Verify Framework Installed
uses: ./.github/actions/assert-opendaq-installed

- name: Verify Framework Version
uses: ./.github/actions/assert-opendaq-version-equals
with:
expected-version: ${{ steps.install.outputs.version }}

windows-autodetect:
name: Windows Autodetect
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Framework
id: install
uses: ./install-framework

- name: Verify Framework Installed
uses: ./.github/actions/assert-opendaq-installed

- name: Verify Framework Version
uses: ./.github/actions/assert-opendaq-version-equals
with:
expected-version: ${{ steps.install.outputs.version }}

windows-autodetect-32bit:
name: Windows Autodetect (32-bit)
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Framework
id: install
uses: ./install-framework
with:
enable-32bit: true

- name: Verify Framework Installed
uses: ./.github/actions/assert-opendaq-installed
with:
enable-32bit: true

- name: Verify Framework Version
uses: ./.github/actions/assert-opendaq-version-equals
with:
expected-version: ${{ steps.install.outputs.version }}
enable-32bit: true

windows-versions-explicit:
name: Windows ${{ matrix.version }} (${{ matrix.enable-32bit && '32-bit' || '64-bit' }})
runs-on: windows-latest
strategy:
fail-fast: false
max-parallel: 1
matrix:
version:
- v3.30.0
- v3.29.0-rc
- v3.20.4
- v3.19.4-rc
enable-32bit:
- true
- false
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Framework
id: install
uses: ./install-framework
with:
version: ${{ matrix.version }}
enable-32bit: ${{ matrix.enable-32bit }}

- name: Verify Framework Installed
uses: ./.github/actions/assert-opendaq-installed
with:
enable-32bit: ${{ matrix.enable-32bit }}

- name: Verify Framework Version
uses: ./.github/actions/assert-opendaq-version-equals
with:
expected-version: ${{ matrix.version }}
enable-32bit: ${{ matrix.enable-32bit }}

windows-versions-aliased:
name: Windows ${{ matrix.version }} (${{ matrix.enable-32bit && '32-bit' || '64-bit' }})
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
version:
- latest
- latest-stable
enable-32bit:
- true
- false
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Framework
id: install
uses: ./install-framework
with:
version: ${{ matrix.version }}
enable-32bit: ${{ matrix.enable-32bit }}

- name: Verify Framework Installed
uses: ./.github/actions/assert-opendaq-installed
with:
enable-32bit: ${{ matrix.enable-32bit }}

- name: Verify Framework Version
uses: ./.github/actions/assert-opendaq-version-equals
with:
expected-version: ${{ steps.install.outputs.version }}
enable-32bit: ${{ matrix.enable-32bit }}
Loading