Skip to content

Commit

Permalink
alsa??
Browse files Browse the repository at this point in the history
  • Loading branch information
subalterngames committed Aug 19, 2024
1 parent 562f9cd commit 1a99269
Show file tree
Hide file tree
Showing 2 changed files with 271 additions and 446 deletions.
47 changes: 21 additions & 26 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,10 @@ env:
RUSTFLAGS: "-Dwarnings"

jobs:
apt:
name: ubuntu-latest apt install
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04]
steps:
- uses: actions/checkout@v4
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: clang cmake speech-dispatcher libspeechd-dev pkg-config libssl-dev alsa librust-alsa-sys-dev
version: 1.0
# Check for formatting and clippy
lint:
name: cargo fmt && cargo clippy
name: Lint
runs-on: ubuntu-latest
needs: apt
steps:
- uses: actions/checkout@v4

Expand All @@ -47,6 +33,10 @@ jobs:
components: rustfmt
override: true

# Install the required dependencies
- name: Install test dependencies
run: sudo apt install clang cmake speech-dispatcher libspeechd-dev pkg-config libssl-dev alsa librust-alsa-sys-dev -y

# Cargo fmt
- uses: actions-rs/cargo@v1
with:
Expand All @@ -59,29 +49,36 @@ jobs:
command: clippy
args: --all-targets --features speech_dispatcher_0_11

# Run test check on Linux, macOS, and Windows,
# Run test check on Linux, macOS, and Windows.
test:
name: cargo test
needs: lint
name: Test
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
fail-fast: true
matrix:
os: [ubuntu-24.04, ubuntu-22.04, ubuntu-20.04, macOS-14, macOS-13, macOS-12, windows-latest]
steps:
# Install rust stable
- uses: actions/checkout@v4

# Install Rust stable.
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable

# Install the required dependencies on Ubuntu.
- name: Install test dependencies
run: sudo apt install clang cmake speech-dispatcher libspeechd-dev pkg-config libssl-dev alsa librust-alsa-sys-dev -y
if: ${{ contains(matrix.os, 'ubuntu') }}

# Test for Ubuntu 20.04. Copy a valid speechd.conf file and then test.
- name: Test
run: |
sudo cp test_files/ubuntu20.04/speechd.conf /etc/speech-dispatcher/speechd.conf
cargo test --all --features speech_dispatcher_0_9 -- --nocapture
if: matrix.os == 'ubuntu-20.04'

# Test for Ubuntu 22.04
# Test for Ubuntu 22.04.
- name: Test
run: cargo test --all --features speech_dispatcher_0_11 -- --nocapture
if: matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-24.04'
Expand All @@ -90,17 +87,15 @@ jobs:
- name: Test
run: cargo test --all -- --nocapture
if: ${{ !contains(matrix.os, 'ubuntu') }}
# Run windowed tests.
windowed_test:
needs: test
runs-on: ubuntu-latest
timeout-minutes: 10
steps:

# Windowed application tests.
- name: Test events
env:
SOUNDFONTS_DIRECTORY: $HOME/Documents/cacophony/soundfonts
run: |
mkdir -p ${{ env.SOUNDFONTS_DIRECTORY }}
cp -r test_files/soundfonts/* ${{ env.SOUNDFONTS_DIRECTORY }}
sudo apt install alsa-utils xvfb -y
sudo modprobe snd-dummy
for f in test_files/events/*.txt ; do echo "Quit\nQuitPanelYes" >> $f && xvfb-run cargo run -- --events $f ; done
if: matrix.os == 'ubuntu-24.04'
Loading

0 comments on commit 1a99269

Please sign in to comment.