Skip to content

Commit 28cbd94

Browse files
author
Aliaksandr Adziareika
committed
<TBBAS-2530> Add determine openDAQ version action
1 parent 369e918 commit 28cbd94

File tree

3 files changed

+121
-82
lines changed

3 files changed

+121
-82
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Determine openDAQ framework latest artefact
2+
3+
inputs:
4+
win32-force:
5+
required: false
6+
default: false
7+
8+
outputs:
9+
version:
10+
description: "Latest openDAQ release version"
11+
platform:
12+
description: "Detected platform"
13+
packaging:
14+
description: "Package type (deb/exe)"
15+
artefact:
16+
description: "Artefact filename"
17+
value: ${{ steps.determine-framework.outputs.artefact }}
18+
uri:
19+
description: "Full URI to artefact"
20+
value: ${{ steps.determine-framework.outputs.uri }}
21+
scheme:
22+
description: "Scheme (s3)"
23+
authority:
24+
description: "Authority (bucket)"
25+
path:
26+
description: "Path inside bucket"
27+
28+
runs:
29+
using: composite
30+
steps:
31+
- name: Determine openDAQ package latest release version
32+
id: determine-framework
33+
shell: bash
34+
run: |
35+
set -e
36+
37+
version=$(gh api repos/openDAQ/openDAQ/releases/latest --jq '.tag_name')
38+
if [[ -z "$version" || "$version" == "null" ]]; then
39+
echo "::error::Failed to determine latest openDAQ release version"
40+
exit 1
41+
fi
42+
43+
version=${version#v}
44+
platform=""
45+
packaging=""
46+
47+
if [[ "${{ runner.os }}" == "Linux" ]]; then
48+
arch=$(uname -m)
49+
if [[ "$arch" == "x86_64" ]]; then
50+
platform="ubuntu22.04-x86_64"
51+
elif [[ "$arch" == "aarch64" ]]; then
52+
platform="ubuntu22.04-arm64"
53+
else
54+
echo "::error::Unsupported Linux arch: $arch"
55+
exit 1
56+
fi
57+
packaging="deb"
58+
59+
elif [[ "${{ runner.os }}" == "Windows" ]]; then
60+
if [[ "${{ inputs.win32-force }}" == "true" ]]; then
61+
platform="win32"
62+
else
63+
platform="win64"
64+
fi
65+
packaging="exe"
66+
67+
else
68+
echo "::error::Unsupported runner OS ${{ runner.os }}"
69+
exit 1
70+
fi
71+
72+
artefact="opendaq-${version}-${platform}.${packaging}"
73+
scheme="s3"
74+
authority="bb-blueberry-sdk-releases"
75+
sdk="releases/v${version}/SDK"
76+
77+
echo "version=$version" >> $GITHUB_OUTPUT
78+
echo "platform=$platform" >> $GITHUB_OUTPUT
79+
echo "packaging=$packaging" >> $GITHUB_OUTPUT
80+
echo "artefact=$artefact" >> $GITHUB_OUTPUT
81+
echo "scheme=$scheme" >> $GITHUB_OUTPUT
82+
echo "authority=$authority" >> $GITHUB_OUTPUT
83+
echo "path=$sdk" >> $GITHUB_OUTPUT
84+
echo "uri=${scheme}://${authority}/${sdk}/${artefact}" >> $GITHUB_OUTPUT

.github/workflows/ci.yml

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,48 @@
1-
name: Build and Test example module
1+
name: Build and Test simple device module with latest openDAQ release
22

33
on:
44
pull_request:
55
branches:
66
- main
77
- jira/*
88

9+
env:
10+
GH_TOKEN: ${{ github.token }}
11+
912
jobs:
1013
build-and-test:
1114
runs-on: ubuntu-latest
1215
steps:
13-
- name: Stop
14-
run: exit 1
15-
16-
- name: Checkout repo
17-
uses: actions/checkout@v4
18-
19-
- name: Install dependencies
20-
run: |
21-
sudo apt-get update && sudo apt-get install -y git wget cmake ninja-build mono-complete g++ libgmock-dev
22-
wget -v https://docs.opendaq.com/download/SDK/opendaq-3.20.4-ubuntu22.04-x86_64.deb -O /tmp/opendaq.deb
23-
sudo dpkg -i /tmp/opendaq.deb || sudo apt-get install -f -y
24-
25-
- name: Configure CMake
26-
run: cmake -B build/output -S . -G Ninja -DOPENDAQ_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release
27-
28-
- name: Build
29-
run: cmake --build build/output --target all
30-
31-
- name: Run tests with GTest report
32-
run: |
33-
mkdir -p build/reports
34-
export GTEST_OUTPUT=xml:$(pwd)/build/reports/gtest-report.xml
35-
ctest --test-dir build/output --output-on-failure -V
36-
37-
- name: Upload test report artifact
38-
if: always()
39-
uses: actions/upload-artifact@v4
40-
with:
41-
name: gtest-report
42-
path: build/reports/gtest-report.xml
16+
17+
- name: Checkout simple device module repo
18+
uses: actions/checkout@v4
19+
20+
- name: Determine openDAQ framework package
21+
id: opendaq-framework
22+
uses: ./.github/actions/framework-latest-release
23+
24+
- name: Donwload openDAQ framework
25+
uses: ./.github/actions/framework-download
26+
with:
27+
src-opendaq-framework-dev: ${{ steps.opendaq-framework.outputs.uri }}
28+
dst-opendaq-framework-dev: ${{ runner.temp }}/${{ steps.opendaq-framework.outputs.artefact }}
29+
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
30+
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
31+
aws_region: ${{ secrets.AWS_REGION }}
32+
33+
- name: Install openDAQ framework package
34+
uses: ./.github/actions/framework-install
35+
with:
36+
src-opendaq-framework: ${{ runner.temp }}/${{ steps.opendaq-framework.outputs.artefact }}
37+
38+
- name: Configure CMake
39+
run: cmake -B build/output -S . -G Ninja -DOPENDAQ_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release
40+
41+
- name: Build
42+
run: cmake --build build/output --target all
43+
44+
- name: Run tests with GTest report
45+
run: |
46+
mkdir -p build/reports
47+
export GTEST_OUTPUT=xml:$(pwd)/build/reports/gtest-report.xml
48+
ctest --test-dir build/output --output-on-failure -V

.github/workflows/opendaq-download-framework-aws.yml

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)