Skip to content

Commit 97559b4

Browse files
author
Aliaksandr Adziareika
committed
<TBBAS-2530> Cleanup commented yml code
1 parent 28cbd94 commit 97559b4

File tree

4 files changed

+78
-52
lines changed

4 files changed

+78
-52
lines changed
Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
name: Download openDAQ framework package from S3
2-
description: "Download a package from S3 and install it depending on OS and architecture"
1+
name: Download openDAQ framework package
2+
description: "Download a package from S3 for Linux or Windows"
3+
34
inputs:
45
src-opendaq-framework-dev:
56
required: true
7+
description: "S3 path to the package"
68
dst-opendaq-framework-dev:
79
required: false
810
default: ${{ runner.temp }}
9-
11+
description: "Destination path for downloaded package"
12+
1013
aws_access_key_id:
1114
required: true
1215
description: "AWS Access Key ID"
@@ -16,14 +19,6 @@ inputs:
1619
aws_region:
1720
required: true
1821
description: "AWS Region"
19-
20-
shell:
21-
required: false
22-
default: "bash"
23-
24-
debug:
25-
required: false
26-
default: false
2722

2823
runs:
2924
using: composite
@@ -35,17 +30,21 @@ runs:
3530
aws-secret-access-key: ${{ inputs.aws_secret_access_key }}
3631
aws-region: ${{ inputs.aws_region }}
3732

38-
# - name: Enumerate bucket
39-
# shell: ${{ inputs.shell }}
40-
# run: |
41-
# aws s3 ls "s3://${{ inputs.s3_bucket }}" --recursive --human-readable
42-
43-
# - name: Enumerate bucket releases main
44-
# shell: ${{ inputs.shell }}
45-
# run: |
46-
# aws s3 ls "s3://${{ inputs.s3_bucket }}/${{ inputs.s3_path }}" --recursive --human-readable
33+
- name: Download package from S3 (Linux/macOS)
34+
if: runner.os != 'Windows'
35+
shell: bash
36+
run: |
37+
set -e
38+
DST="${{ inputs.dst-opendaq-framework-dev }}"
39+
SRC="${{ inputs.src-opendaq-framework-dev }}"
40+
echo "Downloading $SRC to $DST"
41+
aws s3 cp "$SRC" "$DST"
4742
48-
- name: Download package from S3
49-
shell: ${{ inputs.shell }}
43+
- name: Download package from S3 (Windows)
44+
if: runner.os == 'Windows'
45+
shell: pwsh
5046
run: |
51-
aws s3 cp "${{ inputs.src-opendaq-framework-dev }}" "${{ inputs.dst-opendaq-framework-dev }}"
47+
$dst = "${{ inputs.dst-opendaq-framework-dev }}"
48+
$src = "${{ inputs.src-opendaq-framework-dev }}"
49+
Write-Host "Downloading $src to $dst"
50+
aws s3 cp "$src" "$dst"
Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
11
name: Install openDAQ framework package
2+
23
inputs:
3-
src-opendaq-framework:
4+
opendaq-framework-package-filename:
45
required: true
56

7+
opendaq-framework-package-path:
8+
required: false
9+
default: ${{ runner.temp }}
10+
611
runs:
712
using: composite
8-
13+
914
steps:
1015
- name: Install openDAQ framework package (Windows)
11-
if: runner.OS == 'Windows'
12-
shell: powershell
13-
run: ${{ inputs.src-opendaq-framework}} /S
16+
if: runner.os == 'Windows'
17+
shell: pwsh
18+
run: |
19+
$packagePath = Join-Path "${{ inputs.opendaq-framework-package-path }}" "${{ inputs.opendaq-framework-package-filename }}"
20+
& $packagePath /S
1421
1522
- name: Install openDAQ framework package (Linux)
16-
if: ${{ runner.OS }} == 'Linux'
23+
if: runner.os == 'Linux'
1724
shell: bash
18-
run: sudo dpkg -i ${{ inputs.src-opendaq-framework }}
25+
run: sudo dpkg -i "${{ inputs.opendaq-framework-package-path }}/${{ inputs.opendaq-framework-package-filename }}"
1926

2027
- name: Unsupported runner OS
2128
if: runner.os != 'Windows' && runner.os != 'Linux'
2229
shell: bash
23-
run:
30+
run: |
2431
echo "Install openDAQ is not supported for ${{ runner.os }}"
2532
exit 1

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

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Determine openDAQ framework latest artefact
1+
name: Determine latest openDAQ framework artefact
22

33
inputs:
44
win32-force:
@@ -8,28 +8,34 @@ inputs:
88
outputs:
99
version:
1010
description: "Latest openDAQ release version"
11+
value: ${{ steps.determine-latest-package.outputs.version }}
1112
platform:
1213
description: "Detected platform"
14+
value: ${{ steps.determine-latest-package.outputs.platform }}
1315
packaging:
1416
description: "Package type (deb/exe)"
17+
value: ${{ steps.determine-latest-package.outputs.packaging }}
1518
artefact:
1619
description: "Artefact filename"
17-
value: ${{ steps.determine-framework.outputs.artefact }}
20+
value: ${{ steps.determine-latest-package.outputs.artefact }}
1821
uri:
1922
description: "Full URI to artefact"
20-
value: ${{ steps.determine-framework.outputs.uri }}
23+
value: ${{ steps.determine-latest-package.outputs.uri }}
2124
scheme:
2225
description: "Scheme (s3)"
26+
value: ${{ steps.determine-latest-package.outputs.scheme }}
2327
authority:
2428
description: "Authority (bucket)"
29+
value: ${{ steps.determine-latest-package.outputs.authority }}
2530
path:
2631
description: "Path inside bucket"
32+
value: ${{ steps.determine-latest-package.outputs.path }}
2733

2834
runs:
2935
using: composite
3036
steps:
31-
- name: Determine openDAQ package latest release version
32-
id: determine-framework
37+
- name: Determine latest openDAQ package
38+
id: determine-latest-package
3339
shell: bash
3440
run: |
3541
set -e
@@ -44,7 +50,7 @@ runs:
4450
platform=""
4551
packaging=""
4652
47-
if [[ "${{ runner.os }}" == "Linux" ]]; then
53+
if [[ "$RUNNER_OS" == "Linux" ]]; then
4854
arch=$(uname -m)
4955
if [[ "$arch" == "x86_64" ]]; then
5056
platform="ubuntu22.04-x86_64"
@@ -56,16 +62,17 @@ runs:
5662
fi
5763
packaging="deb"
5864
59-
elif [[ "${{ runner.os }}" == "Windows" ]]; then
60-
if [[ "${{ inputs.win32-force }}" == "true" ]]; then
65+
elif [[ "$RUNNER_OS" == "Windows" ]]; then
66+
WIN32_FORCE="${{ inputs.win32-force }}"
67+
if [[ "$WIN32_FORCE" == "true" ]]; then
6168
platform="win32"
6269
else
6370
platform="win64"
6471
fi
6572
packaging="exe"
6673
6774
else
68-
echo "::error::Unsupported runner OS ${{ runner.os }}"
75+
echo "::error::Unsupported runner OS $RUNNER_OS"
6976
exit 1
7077
fi
7178

.github/workflows/ci.yml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,25 @@ on:
77
- jira/*
88

99
env:
10-
GH_TOKEN: ${{ github.token }}
10+
GH_TOKEN: ${{ github.token }}
1111

1212
jobs:
13-
build-and-test:
14-
runs-on: ubuntu-latest
15-
steps:
16-
13+
build-and-test:
14+
runs-on: ${{ matrix.os }}
15+
16+
strategy:
17+
matrix:
18+
os: [windows-latest]
19+
20+
steps:
1721
- name: Checkout simple device module repo
1822
uses: actions/checkout@v4
1923

2024
- name: Determine openDAQ framework package
2125
id: opendaq-framework
2226
uses: ./.github/actions/framework-latest-release
2327

24-
- name: Donwload openDAQ framework
28+
- name: Download openDAQ framework
2529
uses: ./.github/actions/framework-download
2630
with:
2731
src-opendaq-framework-dev: ${{ steps.opendaq-framework.outputs.uri }}
@@ -33,16 +37,25 @@ jobs:
3337
- name: Install openDAQ framework package
3438
uses: ./.github/actions/framework-install
3539
with:
36-
src-opendaq-framework: ${{ runner.temp }}/${{ steps.opendaq-framework.outputs.artefact }}
40+
opendaq-framework-package-filename: ${{ steps.opendaq-framework.outputs.artefact }}
41+
42+
- name: Setup cmake
43+
if: runner.os == 'Windows'
44+
uses: jwlawson/actions-setup-cmake@v2
45+
with:
46+
cmake-version: '4.0'
47+
48+
- name: Install ninja-build
49+
if: runner.os == 'Windows'
50+
uses: seanmiddleditch/gha-setup-ninja@v5
3751

38-
- name: Configure CMake
52+
- name: Configure simple device module with CMake
3953
run: cmake -B build/output -S . -G Ninja -DOPENDAQ_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release
4054

41-
- name: Build
55+
- name: Build simple device module with CMake
4256
run: cmake --build build/output --target all
4357

44-
- name: Run tests with GTest report
58+
- name: Run simple device module tests via CTest with GTest report
4559
run: |
4660
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
61+
GTEST_OUTPUT=xml:$(pwd)/build/reports/gtest-report.xml ctest --test-dir build/output --output-on-failure -V

0 commit comments

Comments
 (0)