Skip to content

Commit 4d80652

Browse files
committed
<TBBAS-2523> Create reusable workflow and composite action for module build and test
- Add ci-framework.yml: reusable workflow for testing with openDAQ framework artifacts - Add module-build-test composite action: automated CMake configure, build, and test - Update ci.yml: use new composite action, add fail-fast: false for matrix jobs
1 parent 66952b1 commit 4d80652

File tree

7 files changed

+152
-254
lines changed

7 files changed

+152
-254
lines changed

.github/actions/framework-download/action.yml

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

.github/actions/framework-install/action.yml

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

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

Lines changed: 0 additions & 111 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Build and test simple device module
2+
description: Configure, build and test simple device module with CMake
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: Set CMake generator
8+
shell: bash
9+
run: |
10+
if [[ "${{ runner.os }}" == "Windows" ]]; then
11+
echo "CMAKE_GENERATOR=Visual Studio 17 2022" >> $GITHUB_ENV
12+
else
13+
echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV
14+
fi
15+
16+
- name: Configure simple device module with CMake
17+
shell: bash
18+
run: |
19+
cmake -B build/output -S . -G "$CMAKE_GENERATOR" -DEXAMPLE_MODULE_ENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release
20+
21+
- name: Build simple device module with CMake
22+
shell: bash
23+
run: |
24+
cmake --build build/output --config Release
25+
26+
- name: Run simple device module tests with CMake
27+
shell: bash
28+
run: |
29+
ctest --test-dir build/output --output-on-failure -C Release -V

.github/workflows/ci-framework.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Build simple device module with openDAQ framework and run tests
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
runner:
7+
description: "Runner label"
8+
required: true
9+
type: string
10+
11+
branch:
12+
description: "Branch to checkout"
13+
required: false
14+
type: string
15+
default: ""
16+
17+
artifact-run-id:
18+
required: true
19+
type: string
20+
21+
artifact-name:
22+
required: true
23+
type: string
24+
25+
file-name:
26+
required: true
27+
type: string
28+
29+
workflow_call:
30+
inputs:
31+
runner:
32+
description: "Runner label"
33+
required: true
34+
type: string
35+
36+
branch:
37+
description: "Branch to checkout"
38+
required: false
39+
type: string
40+
default: ""
41+
42+
artifact-run-id:
43+
required: true
44+
type: string
45+
46+
artifact-name:
47+
required: true
48+
type: string
49+
50+
file-name:
51+
required: true
52+
type: string
53+
54+
env:
55+
GH_TOKEN: ${{ github.token }}
56+
57+
jobs:
58+
test-artifact:
59+
runs-on: ${{ inputs.runner }}
60+
61+
steps:
62+
- name: Checkout openDAQ module repository
63+
uses: actions/checkout@v4
64+
with:
65+
repository: openDAQ/SimpleDeviceModule
66+
ref: ${{ inputs.branch }}
67+
68+
- name: Download openDAQ framework artifact
69+
id: download
70+
uses: openDAQ/actions/framework-download-artifact@jira/TBBAS-2680-opendaq-gh-actions-github-api-wrapper-unit-tests
71+
with:
72+
run-id: ${{ inputs.artifact-run-id }}
73+
artifact-name: ${{ inputs.artifact-name }}
74+
artifact-filename: ${{ inputs.file-name }}
75+
76+
- name: Install openDAQ framework artifact
77+
uses: openDAQ/actions/framework-install@jira/TBBAS-2680-opendaq-gh-actions-github-api-wrapper-unit-tests
78+
with:
79+
framework-filename: ${{ steps.download.outputs.artifact }}
80+
81+
- name: Build and test simple device module
82+
uses: ./.github/actions/module-build-test

0 commit comments

Comments
 (0)