add a new workflow to experiment with building in a container #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | |
| steps: | |
| - name: Download OpenTelemetry-Matlab source | |
| uses: actions/checkout@v3 | |
| with: | |
| path: opentelemetry-matlab | |
| - name: Install compiler and cmake | |
| run: apt update && apt install -y build-essential cmake | |
| - 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=${{ github.ref_name }} -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 |