Skip to content

Added Windows build-and-run-tests job in build.yml file #100

Added Windows build-and-run-tests job in build.yml file

Added Windows build-and-run-tests job in build.yml file #100

Workflow file for this run

name: "OpenTelemetry-Matlab"
on:
workflow_dispatch:
push:
jobs:
build-and-run-tests-ubuntu:
runs-on: ubuntu-latest
env:
OPENTELEMETRY_CPP_INSTALL: "${{ github.workspace }}/otel_cpp_install"
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
OPENTELEMETRY_COLLECTOR_INSTALL: "${{ github.workspace }}/otelcol"
SYSTEM_LIBSTDCPP_PATH: "/usr/lib/x86_64-linux-gnu/libstdc++.so.6"
steps:
- name: Download OpenTelemetry-Matlab source
uses: actions/checkout@v3
with:
path: opentelemetry-matlab
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v1
- name: Download OpenTelemetry Collector binary
run: |
mkdir otelcol && cd otelcol
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.75.0/otelcol_0.75.0_linux_amd64.tar.gz
tar -xzf otelcol_0.75.0_linux_amd64.tar.gz
- name: Build OpenTelemetry-Matlab
run: |
cd opentelemetry-matlab
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
cmake --build build --config Release --target install
- name: Run tests
env:
# The version of libstdc++ that is bundled with MATLAB is used when building MEX files.
# This version of libstdc++ is incompatible with the system version of libstdc++.
# As a workaround, set LD_PRELOAD to use the system version of libstdc++ with MATLAB.
LD_PRELOAD: ${{ env.SYSTEM_LIBSTDCPP_PATH }}
# Add the installation directory to the MATLAB Search Path by
# setting the MATLABPATH environment variable.
MATLABPATH: ${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
uses: matlab-actions/run-tests@v1
with:
select-by-folder: opentelemetry-matlab/test
build-and-run-tests-windows:
runs-on: windows-2022
env:
OPENTELEMETRY_CPP_INSTALL: "${{ github.workspace }}/otel_cpp_install"
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
OPENTELEMETRY_COLLECTOR_INSTALL: "${{ github.workspace }}/otelcol"
steps:
- name: Download OpenTelemetry-Matlab source
uses: actions/checkout@v3
with:
path: opentelemetry-matlab
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v1
- name: Download OpenTelemetry Collector binary
run: |
mkdir otelcol && cd otelcol
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.83.0/otelcol_0.83.0_windows_amd64.tar.gz -outfile otelcol.tar.gz
tar -xzf .\otelcol.tar.gz
- name: Build OpenTelemetry-Matlab
run: |
cd opentelemetry-matlab
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
cmake --build build --config Release --target install
- name: Run tests
env:
# Add the installation directory to the MATLAB Search Path by
# setting the MATLABPATH environment variable.
MATLABPATH: ${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
uses: matlab-actions/run-tests@v1
with:
select-by-folder: opentelemetry-matlab/test