2019-10-03 11:01:35 +00:00
|
|
|
name: cpal
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
clippy-test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2020-04-16 13:20:45 +00:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Update apt
|
|
|
|
run: sudo apt update
|
2019-10-03 11:01:35 +00:00
|
|
|
- name: Install alsa
|
|
|
|
run: sudo apt-get install libasound2-dev
|
2019-10-26 12:34:59 +00:00
|
|
|
- name: Install stable
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
components: clippy
|
2019-10-03 11:01:35 +00:00
|
|
|
- name: Run clippy
|
|
|
|
uses: actions-rs/clippy-check@v1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
args: --all --all-features
|
|
|
|
|
2020-01-20 22:56:04 +00:00
|
|
|
rustfmt-check:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2020-04-16 13:20:45 +00:00
|
|
|
- uses: actions/checkout@v2
|
2020-01-20 22:56:04 +00:00
|
|
|
- name: Install stable
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
|
|
|
components: rustfmt
|
|
|
|
- name: Run rustfmt
|
|
|
|
uses: actions-rs/cargo@v1
|
|
|
|
with:
|
|
|
|
command: fmt
|
2020-01-21 13:18:16 +00:00
|
|
|
args: --all -- --check
|
2020-01-20 22:56:04 +00:00
|
|
|
|
2019-10-04 09:25:24 +00:00
|
|
|
cargo-publish:
|
|
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
2019-10-26 15:09:42 +00:00
|
|
|
env:
|
|
|
|
CRATESIO_TOKEN: ${{ secrets.CRATESIO_TOKEN }}
|
2019-10-04 09:25:24 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2020-04-16 13:20:45 +00:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Update apt
|
|
|
|
run: sudo apt update
|
2019-10-26 12:34:59 +00:00
|
|
|
- name: Install alsa
|
|
|
|
run: sudo apt-get install libasound2-dev
|
2019-10-26 15:09:42 +00:00
|
|
|
- name: Run cargo publish for cpal
|
|
|
|
continue-on-error: true
|
|
|
|
run: |
|
2019-11-15 10:04:28 +00:00
|
|
|
CPAL_TMP=$(mktemp /tmp/cpalXXX.txt) || echo "::error::mktemp error"
|
|
|
|
echo "::set-env name=CPAL_TMP::$CPAL_TMP"
|
2020-07-09 06:41:45 +00:00
|
|
|
cargo publish --token $CRATESIO_TOKEN 2> $CPAL_TMP
|
2019-10-26 15:09:42 +00:00
|
|
|
- name: Check if cpal is already published
|
|
|
|
run: |
|
|
|
|
empty=0
|
2019-11-15 10:04:28 +00:00
|
|
|
grep -q '[^[:space:]]' < $CPAL_TMP || empty=1
|
|
|
|
[ $empty -eq 0 ] && cat $CPAL_TMP
|
|
|
|
[ $empty -eq 1 ] || grep -q "is already uploaded" < $CPAL_TMP
|
2019-10-04 09:25:24 +00:00
|
|
|
|
2019-10-03 11:01:35 +00:00
|
|
|
ubuntu-test:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2020-04-16 13:20:45 +00:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Update apt
|
|
|
|
run: sudo apt update
|
2019-10-03 11:01:35 +00:00
|
|
|
- name: Install alsa
|
|
|
|
run: sudo apt-get install libasound2-dev
|
|
|
|
- name: Install stable
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2019-10-26 12:34:59 +00:00
|
|
|
profile: minimal
|
2019-10-03 11:01:35 +00:00
|
|
|
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:
|
2020-04-16 13:20:45 +00:00
|
|
|
- uses: actions/checkout@v2
|
2019-10-03 11:01:35 +00:00
|
|
|
- name: Install emscripten
|
|
|
|
run: sudo apt-get install emscripten
|
|
|
|
- name: Install stable
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
2019-10-26 12:34:59 +00:00
|
|
|
profile: minimal
|
2019-10-03 11:01:35 +00:00
|
|
|
toolchain: stable
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
- name: Build beep example
|
|
|
|
run: cargo build --example beep --target ${{ matrix.target }}
|
|
|
|
|
2020-01-28 21:00:53 +00:00
|
|
|
wasm32-bindgen-test:
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
target: [wasm32-unknown-unknown]
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v1
|
|
|
|
- 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 }} --features=wasm-bindgen
|
|
|
|
|
2019-10-03 11:01:35 +00:00
|
|
|
windows-test:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
version: [x86_64, i686]
|
|
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
2020-04-16 13:20:45 +00:00
|
|
|
- uses: actions/checkout@v2
|
2019-10-03 11:01:35 +00:00
|
|
|
- name: Install ASIO SDK
|
|
|
|
env:
|
|
|
|
LINK: https://www.steinberg.net/asiosdk
|
|
|
|
run: |
|
2019-10-26 10:22:50 +00:00
|
|
|
curl -L -o asio.zip $env:LINK
|
|
|
|
7z x -oasio asio.zip
|
2019-10-03 11:01:35 +00:00
|
|
|
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:
|
2019-10-26 12:34:59 +00:00
|
|
|
profile: minimal
|
2019-10-03 11:01:35 +00:00
|
|
|
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: |
|
2019-10-26 10:22:50 +00:00
|
|
|
$Env:CPAL_ASIO_DIR = "$Env:GITHUB_WORKSPACE\asio"
|
2019-10-03 11:01:35 +00:00
|
|
|
cargo test --all --all-features --verbose
|
2020-01-16 19:55:49 +00:00
|
|
|
|
|
|
|
macos-test:
|
|
|
|
runs-on: macOS-latest
|
|
|
|
steps:
|
2020-04-16 13:20:45 +00:00
|
|
|
- uses: actions/checkout@v2
|
2020-01-16 19:55:49 +00:00
|
|
|
- name: Install llvm and clang
|
|
|
|
run: brew install llvm
|
|
|
|
- name: Install stable
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
profile: minimal
|
|
|
|
toolchain: stable
|
|
|
|
override: true
|
2020-01-16 20:01:03 +00:00
|
|
|
- name: Build beep example
|
|
|
|
run: cargo build --example beep
|
2020-01-16 19:55:49 +00:00
|
|
|
- name: Run without features
|
|
|
|
run: cargo test --all --no-default-features --verbose
|
|
|
|
- name: Run all features
|
|
|
|
run: cargo test --all --all-features --verbose
|