145 lines
3.7 KiB
YAML
145 lines
3.7 KiB
YAML
name: cpal
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
clippy-test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- name: Install alsa
|
|
run: sudo apt-get install libasound2-dev
|
|
- name: Install stable
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
components: clippy
|
|
- name: Run clippy
|
|
uses: actions-rs/clippy-check@v1
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
args: --all --all-features
|
|
|
|
cargo-publish:
|
|
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
|
|
|
env:
|
|
CRATESIO_TOKEN: ${{ secrets.CRATESIO_TOKEN }}
|
|
ALSA: alsa-sys.txt
|
|
CPAL: cpal.txt
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- name: Install alsa
|
|
run: sudo apt-get install libasound2-dev
|
|
- name: Run cargo publish for alsa-sys
|
|
continue-on-error: true
|
|
env:
|
|
MANIFEST: alsa-sys/Cargo.toml
|
|
run: |
|
|
cargo publish --token $CRATESIO_TOKEN --manifest-path $MANIFEST 2> $ALSA
|
|
- name: Check if alsa-sys is already published
|
|
run: |
|
|
empty=0
|
|
grep -q '[^[:space:]]' < $ALSA || empty=1
|
|
[ $empty -eq 0 ] && cat $ALSA
|
|
[ $empty -eq 1 ] || grep -q "is already uploaded" < $ALSA
|
|
- name: Run cargo publish for cpal
|
|
continue-on-error: true
|
|
run: |
|
|
cargo publish --token $CRATESIO_TOKEN 2> $CPAL
|
|
- name: Check if cpal is already published
|
|
run: |
|
|
empty=0
|
|
grep -q '[^[:space:]]' < $CPAL || empty=1
|
|
[ $empty -eq 0 ] && cat $CPAL
|
|
[ $empty -eq 1 ] || grep -q "is already uploaded" < $CPAL
|
|
|
|
ubuntu-test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- name: Install alsa
|
|
run: sudo apt-get install libasound2-dev
|
|
- name: Install stable
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
override: true
|
|
- name: Run without features
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
args: --all --no-default-features --verbose
|
|
- name: Run all features
|
|
uses: actions-rs/cargo@v1
|
|
with:
|
|
command: test
|
|
args: --all --all-features --verbose
|
|
|
|
asmjs-wasm32-test:
|
|
|
|
strategy:
|
|
matrix:
|
|
target: [asmjs-unknown-emscripten, wasm32-unknown-emscripten]
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- name: Install emscripten
|
|
run: sudo apt-get install emscripten
|
|
- name: Install stable
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
target: ${{ matrix.target }}
|
|
- name: Build beep example
|
|
run: cargo build --example beep --target ${{ matrix.target }}
|
|
|
|
windows-test:
|
|
|
|
strategy:
|
|
matrix:
|
|
version: [x86_64, i686]
|
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v1
|
|
- name: Install ASIO SDK
|
|
env:
|
|
LINK: https://www.steinberg.net/asiosdk
|
|
run: |
|
|
curl -L -o asio.zip $env:LINK
|
|
7z x -oasio asio.zip
|
|
move asio\*\* asio\
|
|
- name: Install ASIO4ALL
|
|
run: choco install asio4all
|
|
- name: Install llvm and clang
|
|
run: choco install llvm
|
|
- name: Install stable
|
|
uses: actions-rs/toolchain@v1
|
|
with:
|
|
profile: minimal
|
|
toolchain: stable
|
|
target: ${{ matrix.version }}-pc-windows-msvc
|
|
override: true
|
|
- name: Run without features
|
|
run: cargo test --all --no-default-features --verbose
|
|
- name: Run all features
|
|
run: |
|
|
$Env:CPAL_ASIO_DIR = "$Env:GITHUB_WORKSPACE\asio"
|
|
cargo test --all --all-features --verbose
|