Skip to content

Commit 32ad9b2

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

File tree

4 files changed

+69
-49
lines changed

4 files changed

+69
-49
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: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
name: Install openDAQ framework package
2+
23
inputs:
34
src-opendaq-framework:
45
required: true
56

67
runs:
78
using: composite
8-
9+
910
steps:
1011
- name: Install openDAQ framework package (Windows)
11-
if: runner.OS == 'Windows'
12-
shell: powershell
13-
run: ${{ inputs.src-opendaq-framework}} /S
12+
if: runner.os == 'Windows'
13+
shell: pwsh
14+
run: '"${{ inputs.src-opendaq-framework }}" /S'
1415

1516
- name: Install openDAQ framework package (Linux)
16-
if: ${{ runner.OS }} == 'Linux'
17+
if: runner.os == 'Linux'
1718
shell: bash
18-
run: sudo dpkg -i ${{ inputs.src-opendaq-framework }}
19+
run: sudo dpkg -i "${{ inputs.src-opendaq-framework }}"
1920

2021
- name: Unsupported runner OS
2122
if: runner.os != 'Windows' && runner.os != 'Linux'
2223
shell: bash
23-
run:
24+
run: |
2425
echo "Install openDAQ is not supported for ${{ runner.os }}"
2526
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: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ 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:
13+
build-and-test:
14+
runs-on: ubuntu-latest
15+
steps:
1616

1717
- name: Checkout simple device module repo
1818
uses: actions/checkout@v4
@@ -21,7 +21,21 @@ jobs:
2121
id: opendaq-framework
2222
uses: ./.github/actions/framework-latest-release
2323

24-
- name: Donwload openDAQ framework
24+
- name: Check openDAQ framework package is detected
25+
run: |
26+
if [[ -z "${{ steps.opendaq-framework.outputs.uri }}" ]]; then
27+
echo "::error::openDAQ framework URI is empty!"
28+
exit 1
29+
fi
30+
if [[ -z "${{ steps.opendaq-framework.outputs.artefact }}" ]]; then
31+
echo "::error::openDAQ artefact name is empty!"
32+
exit 1
33+
fi
34+
35+
- name: Prepare temporary directory
36+
run: mkdir -p ${{ runner.temp }}
37+
38+
- name: Download openDAQ framework
2539
uses: ./.github/actions/framework-download
2640
with:
2741
src-opendaq-framework-dev: ${{ steps.opendaq-framework.outputs.uri }}
@@ -35,14 +49,13 @@ jobs:
3549
with:
3650
src-opendaq-framework: ${{ runner.temp }}/${{ steps.opendaq-framework.outputs.artefact }}
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)