Skip to content

Commit 9163791

Browse files
committed
Add workflow for multiple matlab versions
1 parent ccdd0b9 commit 9163791

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Full build-and-test with gRPC exporter on all Matlab Versions
2+
name: "Build and Run Tests Supported Versions"
3+
env:
4+
MLM_LICENSE_TOKEN: ${{ secrets.MLM_LICENSE_TOKEN }}
5+
jobs:
6+
get_version:
7+
runs-on: ubuntu-22.04
8+
outputs:
9+
version: ${{ steps.getversion.outputs.latest_tag }}
10+
steps:
11+
# need fetch-depth:0 to also download the tags
12+
- name: Download OpenTelemetry-Matlab source
13+
uses: actions/checkout@v3
14+
with:
15+
path: opentelemetry-matlab
16+
fetch-depth: 0
17+
- name: Get Version
18+
id: getversion
19+
shell: bash
20+
working-directory: opentelemetry-matlab
21+
run: echo "latest_tag=$(sed -re 's/^v?([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+)?.*/\1/' <<< $(git describe --tags --abbrev=0))" >> $GITHUB_OUTPUT
22+
build-and-run-tests-macos:
23+
runs-on: ${{ matrix.os }}
24+
strategy:
25+
matrix:
26+
os: [macos-13, macos-14] # runs on Mac with both Intel (macos-13) and Apple Silicon (macos-14) processors
27+
release: [R2025a, R2024b]
28+
needs: get_version
29+
env:
30+
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
31+
steps:
32+
- name: Download OpenTelemetry-Matlab source
33+
uses: actions/checkout@v3
34+
with:
35+
path: opentelemetry-matlab
36+
- name: Install ninja-build
37+
run: brew install ninja
38+
- name: Install MATLAB
39+
uses: matlab-actions/setup-matlab@v2
40+
with:
41+
release: ${{ matrix.release }}
42+
products: MATLAB_Compiler MATLAB_Compiler_SDK
43+
- name: Build OpenTelemetry-Matlab
44+
working-directory: opentelemetry-matlab
45+
env:
46+
CMAKE_POLICY_VERSION_MINIMUM: 3.5 # required by upb because its cmake requirement is not compatible with cmake 4
47+
run: |
48+
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DWITH_EXAMPLES=ON -DWITH_OTLP_GRPC=ON -DUSE_BATCH_FOR_MCC=ON -DOTEL_MATLAB_VERSION=${{ needs.get_version.outputs.version }} -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
49+
cmake --build build --config Release --target install
50+
- name: Run tests
51+
env:
52+
# Add the installation directory to the MATLAB Search Path by
53+
# setting the MATLABPATH environment variable.
54+
MATLABPATH: ${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
55+
uses: matlab-actions/run-tests@v2
56+
with:
57+
select-by-folder: opentelemetry-matlab/test

0 commit comments

Comments
 (0)