Skip to content

add a new workflow to experiment with building in a container #7

add a new workflow to experiment with building in a container

add a new workflow to experiment with building in a container #7

name: "Experiment with building in a Linux container"
on:
push:
branches:
- 'container'
jobs:
build-ubuntu:
runs-on: ubuntu-22.04
container:
image: ubuntu:20.04
env:
OPENTELEMETRY_MATLAB_INSTALL: "${{ github.workspace }}/otel_matlab_install"
DEBIAN_FRONTEND: "noninteractive"
steps:
- name: Download OpenTelemetry-Matlab source
uses: actions/checkout@v3
with:
path: opentelemetry-matlab
- name: Install compiler, cmake, and Git
run: apt update && apt install -y build-essential cmake git
- name: Install ninja-build
run: apt-get install ninja-build
- name: Install MATLAB
uses: matlab-actions/setup-matlab@v2
with:
release: R2025a
products: MATLAB_Compiler
- name: Build OpenTelemetry-Matlab
working-directory: opentelemetry-matlab
run: |
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DWITH_OTLP_GRPC=ON -DWITH_OTLP_FILE=ON -DOTEL_MATLAB_VERSION=1.0.0 -DCMAKE_INSTALL_PREFIX=${{ env.OPENTELEMETRY_MATLAB_INSTALL }}
cmake --build build --config Release --target install
- name: Compress into single artifact
working-directory: ${{ github.workspace }}
run: tar -czf otel-matlab-ubuntu.tar.gz otel_matlab_install
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: otel-matlab-ubuntu.tar.gz
path: ${{ github.workspace }}/otel-matlab-ubuntu.tar.gz