matio-rs 1.5.0

Rust wrapper to MATLAB MAT file I/O library
Documentation
name: Rust

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    name: Build on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}

    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest]
        
    steps:
    - uses: actions/checkout@v4
      with:
        submodules: recursive
    - name: Install zlib (Windows)
      if: runner.os == 'Windows'
      run: |
        git clone https://github.com/Microsoft/vcpkg.git
        .\vcpkg\bootstrap-vcpkg.bat
        .\vcpkg\vcpkg.exe install zlib:x64-windows
        .\vcpkg\vcpkg.exe integrate install
        echo "VCPKG_ROOT=${{ github.workspace }}\vcpkg" >> $GITHUB_ENV
      shell: cmd
    - name: Set Rust/zlib environment variables  
      if: runner.os == 'Windows'
      run: |
        echo "ZLIB_LIB_DIR=${{ github.workspace }}\vcpkg\installed\x64-windows\lib" >> $GITHUB_ENV
        echo "ZLIB_INCLUDE_DIR=${{ github.workspace }}\vcpkg\installed\x64-windows\include" >> $GITHUB_ENV
        echo "LIBZ_SYS_STATIC=1" >> $GITHUB_ENV
      shell: bash
    - name: Build
      run: cargo build --verbose --all-features
    # - name: Test (Windows)
    #   if: runner.os == 'Windows'
    #   run: |
    #     # Set environment variables explicitly for test
    #     $env:ZLIB_LIB_DIR = "${{ github.workspace }}/vcpkg/installed/x64-windows/lib"
    #     $env:ZLIB_INCLUDE_DIR = "${{ github.workspace }}/vcpkg/installed/x64-windows/include"
    #     $env:LIBZ_SYS_STATIC = "1"
    #     $env:RUSTFLAGS = "-L ${{ github.workspace }}/vcpkg/installed/x64-windows/lib"
    #     cargo test --verbose --all-features
    #   shell: powershell  
    - name: Test (Linux)
      if: runner.os == 'Linux'
      run: cargo test --verbose --all-features
    # - name: Run tests
      # run: cargo test --verbose --all-features