cmajor 0.7.0

Rust bindings for the Cmajor JIT engine.
Documentation
name: Build

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

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    strategy:
      matrix:
        os: [ linux, macos ]
        cmajor_version: [ 1.0.2656 ]
        include:
          - os: linux
            runner: ubuntu-latest
            arch: x64
            library_name: libCmajPerformer.so
          - os: macos
            runner: macos-latest
            arch: universal2
            library_name: libCmajPerformer.dylib
    runs-on: ${{ matrix.runner }}
    steps:
      - uses: actions/checkout@v4
      - if: matrix.os == 'linux'
        name: Install dependencies
        run: sudo apt-get install libasound2-dev
      - name: Fetch Cmajor
        run: |
          scripts/fetch-cmajor.py ${{ matrix.cmajor_version }} ${{ matrix.os }} ${{ matrix.arch }}
          echo "CMAJOR_LIB_PATH=${PWD}/cmaj/${{ matrix.cmajor_version }}/${{ matrix.os }}/${{ matrix.arch }}/${{ matrix.library_name }}" > .env
      - name: Build
        run: cargo build --verbose
      - name: Run tests
        run: cargo test --verbose
      - name: Run check for JIT linker issues
        run: cargo run --bin linker_issue

  check-format:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: rustup update nightly && rustup default nightly
      - run: rustup component add rustfmt
      - run: cargo fmt --all --check