Skip to content

Commit f2b7f79

Browse files
authored
Merge pull request #85 from mathworks/testing
Adding Mac & Windows to build
2 parents 32bd557 + 7869efb commit f2b7f79

File tree

2 files changed

+58
-4
lines changed

2 files changed

+58
-4
lines changed

.github/workflows/build.yml

Lines changed: 57 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
workflow_dispatch:
44
push:
55
jobs:
6-
build-and-run-tests:
6+
build-and-run-tests-ubuntu:
77
runs-on: ubuntu-latest
88
env:
99
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
@@ -14,7 +14,9 @@ jobs:
1414
with:
1515
path: opentelemetry-matlab
1616
- name: Install MATLAB
17-
uses: matlab-actions/setup-matlab@v1
17+
uses: matlab-actions/setup-matlab@v2
18+
with:
19+
products: MATLAB_Compiler
1820
- name: Build OpenTelemetry-Matlab
1921
run: |
2022
cd opentelemetry-matlab
@@ -30,6 +32,58 @@ jobs:
3032
# Add the installation directory to the MATLAB Search Path by
3133
# setting the MATLABPATH environment variable.
3234
MATLABPATH: ${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
33-
uses: matlab-actions/run-tests@v1
35+
uses: matlab-actions/run-tests@v2
36+
with:
37+
select-by-folder: opentelemetry-matlab/test
38+
build-and-run-tests-windows:
39+
runs-on: windows-latest
40+
env:
41+
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
42+
steps:
43+
- name: Download OpenTelemetry-Matlab source
44+
uses: actions/checkout@v3
45+
with:
46+
path: opentelemetry-matlab
47+
- name: Install MATLAB
48+
uses: matlab-actions/setup-matlab@v2
49+
with:
50+
products: MATLAB_Compiler
51+
- name: Build OpenTelemetry-Matlab
52+
run: |
53+
cd opentelemetry-matlab
54+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
55+
cmake --build build --config Release --target install
56+
- name: Run tests
57+
env:
58+
# Add the installation directory to the MATLAB Search Path by
59+
# setting the MATLABPATH environment variable.
60+
MATLABPATH: ${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
61+
uses: matlab-actions/run-tests@v2
62+
with:
63+
select-by-folder: opentelemetry-matlab/test
64+
build-and-run-tests-macos:
65+
runs-on: macos-latest
66+
env:
67+
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
68+
steps:
69+
- name: Download OpenTelemetry-Matlab source
70+
uses: actions/checkout@v3
71+
with:
72+
path: opentelemetry-matlab
73+
- name: Install MATLAB
74+
uses: matlab-actions/setup-matlab@v2
75+
with:
76+
products: MATLAB_Compiler
77+
- name: Build OpenTelemetry-Matlab
78+
run: |
79+
cd opentelemetry-matlab
80+
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DWITH_EXAMPLES=ON -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
81+
cmake --build build --config Release --target install
82+
- name: Run tests
83+
env:
84+
# Add the installation directory to the MATLAB Search Path by
85+
# setting the MATLABPATH environment variable.
86+
MATLABPATH: ${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
87+
uses: matlab-actions/run-tests@v2
3488
with:
3589
select-by-folder: opentelemetry-matlab/test

examples/context_propagation/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ set(CONTEXTPROP_EXAMPLE_DEPLOYNAME mymagic)
2020
set(CONTEXTPROP_EXAMPLE_MATLAB_SOURCE ${CMAKE_CURRENT_LIST_DIR}/matlab/${CONTEXTPROP_EXAMPLE_DEPLOYNAME}.m)
2121
set(CONTEXTPROP_EXAMPLE_ROUTES ../../../examples/context_propagation/matlab/routes.json) #somehow, only relative paths are allowed
2222
matlab_get_version_from_matlab_run(${Matlab_MAIN_PROGRAM} Matlab_LIST_VERSION)
23-
if(DEFINED Matlab_LIST_VERSION AND ${Matlab_LIST_VERSION} VERSION_GREATER_EQUAL 23.2.0)
23+
if(Matlab_LIST_VERSION VERSION_GREATER_EQUAL 23.2.0)
2424
# since MATLAB R2023b, route mapping can be specified at the archive level
2525
set(ARCHIVE_ROUTES ",ROUTES:${CONTEXTPROP_EXAMPLE_ROUTES}")
2626
else()

0 commit comments

Comments
 (0)