Skip to content

Commit e4c5bb2

Browse files
author
Aliaksandr Adziareika
committed
<TBBAS-2530> Add CI workflow manual run
1 parent 9326e84 commit e4c5bb2

File tree

2 files changed

+46
-6
lines changed

2 files changed

+46
-6
lines changed

.github/actions/framework-latest-release/action.yml

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,45 @@
11
name: Determine latest openDAQ framework artefact
22

33
inputs:
4+
5+
opendaq-framework-release-version:
6+
required: false
7+
default: latest
8+
49
win32-force:
510
required: false
611
default: false
712

813
outputs:
14+
915
version:
1016
description: "Latest openDAQ release version"
1117
value: ${{ steps.determine-latest-package.outputs.version }}
18+
1219
platform:
1320
description: "Detected platform"
1421
value: ${{ steps.determine-latest-package.outputs.platform }}
22+
1523
packaging:
1624
description: "Package type (deb/exe)"
1725
value: ${{ steps.determine-latest-package.outputs.packaging }}
26+
1827
artefact:
1928
description: "Artefact filename"
2029
value: ${{ steps.determine-latest-package.outputs.artefact }}
30+
2131
uri:
2232
description: "Full URI to artefact"
2333
value: ${{ steps.determine-latest-package.outputs.uri }}
34+
2435
scheme:
2536
description: "Scheme (s3)"
2637
value: ${{ steps.determine-latest-package.outputs.scheme }}
38+
2739
authority:
2840
description: "Authority (bucket)"
2941
value: ${{ steps.determine-latest-package.outputs.authority }}
42+
3043
path:
3144
description: "Path inside bucket"
3245
value: ${{ steps.determine-latest-package.outputs.path }}
@@ -40,13 +53,20 @@ runs:
4053
run: |
4154
set -e
4255
43-
version=$(gh api repos/openDAQ/openDAQ/releases/latest --jq '.tag_name')
44-
if [[ -z "$version" || "$version" == "null" ]]; then
45-
echo "::error::Failed to determine latest openDAQ release version"
46-
exit 1
56+
input_version="${{ inputs.opendaq-framework-release-version }}"
57+
58+
if [[ -z "$input_version" || "$input_version" == "latest" ]]; then
59+
version=$(gh api repos/openDAQ/openDAQ/releases/latest --jq '.tag_name')
60+
if [[ -z "$version" || "$version" == "null" ]]; then
61+
echo "::error::Failed to determine latest openDAQ release version"
62+
exit 1
63+
fi
64+
65+
version=${version#v}
66+
else
67+
version="$input_version"
4768
fi
4869
49-
version=${version#v}
5070
platform=""
5171
packaging=""
5272

.github/workflows/ci.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
11
name: Build and Test simple device module with latest openDAQ release
22

33
on:
4+
push:
5+
branches:
6+
- main
7+
48
pull_request:
59
branches:
610
- main
711
- jira/*
812

13+
workflow_dispatch:
14+
inputs:
15+
16+
branch:
17+
required: false
18+
default: "main"
19+
20+
opendaq-framework-version:
21+
required: false
22+
type: string
23+
default: latest
24+
925
env:
1026
GH_TOKEN: ${{ github.token }}
1127

@@ -17,6 +33,7 @@ jobs:
1733
include:
1834
- os: ubuntu-latest
1935
generator: Ninja
36+
2037
- os: windows-latest
2138
generator: "Visual Studio 17 2022"
2239

@@ -25,10 +42,14 @@ jobs:
2542
steps:
2643
- name: Checkout simple device module repo
2744
uses: actions/checkout@v4
45+
with:
46+
ref: ${{ github.event.inputs.branch || github.event.client_payload.branch || github.ref }}
2847

2948
- name: Determine openDAQ framework package
3049
id: opendaq-framework
3150
uses: ./.github/actions/framework-latest-release
51+
with:
52+
opendaq-framework-release-version: ${{ github.event.inputs.opendaq-framework-version || 'latest' }}
3253

3354
- name: Download openDAQ framework
3455
uses: ./.github/actions/framework-download
@@ -47,7 +68,6 @@ jobs:
4768
- name: Configure simple device module with CMake
4869
run: cmake -B build/output -S . -G "${{ matrix.generator }}" -DEXAMPLE_MODULE_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release
4970

50-
5171
- name: Build simple device module with CMake
5272
run: cmake --build build/output --config Release
5373

0 commit comments

Comments
 (0)