summaryrefslogtreecommitdiff
path: root/.github/workflows/sounddevice-data.yml
blob: 3b1aecbab7135f77800022e4932349cdbcc3e622 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Test PortAudio binaries
on: [push, pull_request]
jobs:
  binaries:
    strategy:
      matrix:
        include:
          - os: macos-latest
            arch: 'arm64'
          # Last version with Intel CPU:
          - os: macos-13
            arch: 'x64'
          - os: windows-latest
            arch: 'x64'
          - os: windows-latest
            arch: 'x86'
    runs-on: ${{ matrix.os }}
    steps:
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: "3.10"
          architecture: ${{ matrix.arch }}
      - name: Double-check Python version
        run: |
          python --version
      - name: Clone Git repository (with submodules)
        uses: actions/checkout@v4
        with:
          path: git-repo
          submodules: true
      - name: Install Python package
        working-directory: git-repo
        run: |
          python -m pip install .
      - name: Import module
        run: |
          python -m sounddevice
          python -c "import sounddevice as sd; print(sd._libname)"
          python -c "import sounddevice as sd; print(sd.get_portaudio_version())"
          python -c "import sounddevice as sd; print(sd.query_hostapis())"
          python -c "import sounddevice as sd; assert 'asio' not in sd._libname"
          python -c "import sounddevice as sd; assert not any(a['name'] == 'ASIO' for a in sd.query_hostapis())"
      - name: Import module (using the ASIO DLL)
        if: startsWith(matrix.os, 'windows')
        env:
          SD_ENABLE_ASIO: 1
        run: |
          python -m sounddevice
          python -c "import sounddevice as sd; print(sd._libname)"
          python -c "import sounddevice as sd; print(sd.get_portaudio_version())"
          python -c "import sounddevice as sd; print(sd.query_hostapis())"
          python -c "import sounddevice as sd; assert 'asio' in sd._libname"
          python -c "import sounddevice as sd; assert any(a['name'] == 'ASIO' for a in sd.query_hostapis())"