unopus 0.0.1

libopus transpiled to rust by c2rust
Documentation
on: [push, pull_request]

name: Run opus tests

jobs:
  test-basic:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        # TODO: test 32-bit targets
        # TODO: test aarch64 targets
        os:
          - ubuntu-latest
          - macOS-latest
          - windows-latest
        profile: [release, dev]
      fail-fast: false

    steps:
      - uses: actions/checkout@v2

      - name: Install toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          override: true
          profile: minimal

      - name: Execute tests
        uses: actions-rs/cargo@v1
        with:
          command: test
          args: --all --profile=${{ matrix.profile }} --all-features -- --nocapture
  test-vectors:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os:
          - ubuntu-latest
          - macOS-latest
          - windows-latest
        rate:
          - 48000
          - 24000
          - 16000
          - 12000
      fail-fast: false

    steps:
      - uses: actions/checkout@v2

      - name: Install toolchain
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          override: true
          profile: minimal

      - name: Build (release)
        uses: actions-rs/cargo@v1
        with:
          command: build
          args: --release --all-features

      - name: Download test vectors from IETF site
        run: |
          curl https://www.ietf.org/proceedings/98/slides/materials-98-codec-opus-newvectors-00.tar.gz -o materials-98-codec-opus-newvectors-00.tar.gz
          tar -xzf materials-98-codec-opus-newvectors-00.tar.gz
          # the vectors are now extracted to opus_newvectors

      - name: Run test vectors
        uses: actions-rs/cargo@v1
        with:
          command: run
          args: --release --bin run_vectors --all-features -- target/release opus_newvectors ${{ matrix.rate }}

      - name: Upload logs
        if: always() # always upload logs, even if the test fails
        uses: actions/upload-artifact@v3
        with:
          name: test-logs
          path: logs_*.txt