1+ name : " OpenTelemetry-Matlab"
2+ on :
3+ workflow_dispatch :
4+ push :
5+ env :
6+ MLM_LICENSE_TOKEN : ${{ secrets.MLM_LICENSE_TOKEN }}
7+ jobs :
8+ get_version :
9+ runs-on : ubuntu-20.04
10+ outputs :
11+ version : ${{ steps.getversion.outputs.latest_tag }}
12+ steps :
13+ # need fetch-depth:0 to also download the tags
14+ - name : Download OpenTelemetry-Matlab source
15+ uses : actions/checkout@v3
16+ with :
17+ path : opentelemetry-matlab
18+ fetch-depth : 0
19+ - name : Get Version
20+ id : getversion
21+ shell : bash
22+ working-directory : opentelemetry-matlab
23+ run : echo "latest_tag=$(sed -re 's/^v?([[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+)?.*/\1/' <<< $(git describe --tags --abbrev=0))" >> $GITHUB_OUTPUT
24+ codecov-ubuntu :
25+ # Running on ubuntu-latest would use a glibc version that is incompatible when using the built mex files on a Debian 11
26+ # Instead, run on ubuntu-20.04
27+ runs-on : ubuntu-20.04
28+ needs : get_version
29+ env :
30+ OPENTELEMETRY_MATLAB_INSTALL : " ${{ github.workspace }}/otel_matlab_install"
31+ SYSTEM_LIBSTDCPP_PATH : " /usr/lib/x86_64-linux-gnu/libstdc++.so.6"
32+ steps :
33+ - name : Download OpenTelemetry-Matlab source
34+ uses : actions/checkout@v3
35+ with :
36+ path : opentelemetry-matlab
37+ - name : Install ninja-build
38+ run : sudo apt-get install ninja-build
39+ - name : Install MATLAB
40+ uses : matlab-actions/setup-matlab@v2
41+ with :
42+ products : MATLAB_Compiler MATLAB_Compiler_SDK
43+ - name : Build OpenTelemetry-Matlab
44+ working-directory : opentelemetry-matlab
45+ run : |
46+ cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DWITH_EXAMPLES=ON -DUSE_BATCH_FOR_MCC=ON -DOTEL_MATLAB_VERSION=${{ needs.get_version.outputs.version }} -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
47+ cmake --build build --config Release --target install
48+ - name : Get Codecov
49+ env :
50+ # Add the installation directory to the MATLAB Search Path by
51+ # setting the MATLABPATH environment variable.
52+ MATLABPATH : ${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
53+ uses : matlab-actions/run-tests@v2
54+ with :
55+ source-folder : ${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
56+ code-coverage-cobertura : cobertura.xml
57+ - name : Upload Codecov
58+ uses : codecov/codecov-action@v4
59+ with :
60+ token : ${{ secrets.CODECOV_TOKEN }}
61+ slug : mathworks/OpenTelemetry-Matlab
62+ file : cobertura.xml
0 commit comments