-
Notifications
You must be signed in to change notification settings - Fork 0
Add install-framework action #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
alexadereyko
wants to merge
2
commits into
main
Choose a base branch
from
jira/TBBAS-2871-download-and-install-sdk
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| } | ||
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.