| 1 |
name: Build & Test |
| 2 |
|
| 3 |
on: [push, pull_request] |
| 4 |
|
| 5 |
jobs: |
| 6 |
build: |
| 7 |
runs-on: ${{ matrix.os }} |
| 8 |
continue-on-error: ${{ matrix.experimental }} |
| 9 |
strategy: |
| 10 |
fail-fast: false |
| 11 |
matrix: |
| 12 |
os: [macos-12, macos-13, macos-14] |
| 13 |
rust: [stable] |
| 14 |
experimental: [false] |
| 15 |
include: |
| 16 |
- os: macos-14 |
| 17 |
rust: nightly |
| 18 |
experimental: true |
| 19 |
|
| 20 |
steps: |
| 21 |
- uses: actions/checkout@v4 |
| 22 |
with: |
| 23 |
submodules: recursive |
| 24 |
|
| 25 |
- name: Install Rust |
| 26 |
run: rustup toolchain install ${{ matrix.rust }} --profile minimal --component rustfmt clippy |
| 27 |
|
| 28 |
- name: Setup Rust |
| 29 |
run: | |
| 30 |
rustup default ${{ matrix.rust }} |
| 31 |
toolchain=$(rustup default) |
| 32 |
echo "Use Rust toolchain: $toolchain" |
| 33 |
rustc --version |
| 34 |
cargo --version |
| 35 |
|
| 36 |
- name: Setup switchaudio |
| 37 |
if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-14' }} |
| 38 |
run: | |
| 39 |
brew install switchaudio-osx |
| 40 |
|
| 41 |
- name: Setup blackhole-2ch |
| 42 |
run: | |
| 43 |
brew install blackhole-2ch |
| 44 |
SwitchAudioSource -s "BlackHole 2ch" -t input |
| 45 |
SwitchAudioSource -s "BlackHole 2ch" -t output |
| 46 |
|
| 47 |
- name: Grant microphone access |
| 48 |
if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-14' }} |
| 49 |
env: |
| 50 |
tcc_extra_columns: ${{ matrix.os == 'macos-14' && ',NULL,NULL,''UNUSED'',1687786159' || '' }} |
| 51 |
run: sqlite3 $HOME/Library/Application\ Support/com.apple.TCC/TCC.db "INSERT OR IGNORE INTO access VALUES ('kTCCServiceMicrophone','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159${{ env.tcc_extra_columns }});" |
| 52 |
|
| 53 |
- name: Build |
| 54 |
run: cargo build --verbose |
| 55 |
|
| 56 |
- name: Regular Test |
| 57 |
run: sh run_tests.sh |
| 58 |
|
| 59 |
- name: Sanitizer Test |
| 60 |
if: ${{ matrix.rust == 'nightly' }} |
| 61 |
run: sh run_sanitizers.sh |