2021-03-09 05:54:56 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches: [main, master]
|
|
|
|
|
|
|
|
env:
|
|
|
|
RUSTFLAGS: "-C debuginfo=0 -D warnings"
|
|
|
|
CARGO_TERM_COLOR: always
|
|
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
tests:
|
|
|
|
name: Tests
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
continue-on-error: ${{ matrix.toolchain == 'nightly' }}
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
|
|
|
toolchain: [stable, beta, nightly]
|
|
|
|
include:
|
|
|
|
- os: macos-latest
|
|
|
|
MACOS: true
|
|
|
|
- os: windows-latest
|
|
|
|
- os: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: install linux deps
|
|
|
|
run: |
|
|
|
|
sudo apt update
|
2021-06-29 07:12:28 +00:00
|
|
|
sudo apt install -y --no-install-recommends libasound2-dev pkg-config
|
2021-03-09 05:54:56 +00:00
|
|
|
if: contains(matrix.os, 'ubuntu')
|
|
|
|
|
|
|
|
- name: install ${{ matrix.toolchain }} toolchain
|
|
|
|
id: install_toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: ${{ matrix.toolchain }}
|
|
|
|
profile: minimal
|
|
|
|
# Don't use a 'components:' entry--we don't need them with beta/nightly, plus nightly often doesn't have them
|
|
|
|
override: true
|
|
|
|
|
|
|
|
# This block can be uncommented to add clippy to CI, but first the existing clippy warnings need to be fixed!
|
|
|
|
# - name: clippy
|
|
|
|
# run: |
|
|
|
|
# rustup component add clippy
|
|
|
|
# cargo clippy -- -D warnings
|
|
|
|
# if: matrix.toolchain == 'stable' && matrix.os == 'ubuntu-latest'
|
|
|
|
|
|
|
|
- run: |
|
|
|
|
rustup component add rustfmt
|
|
|
|
cargo fmt --all -- --check
|
|
|
|
if: matrix.toolchain == 'stable' && matrix.os == 'ubuntu-latest'
|
|
|
|
|
2021-06-29 07:12:28 +00:00
|
|
|
- run: cargo test --all-targets
|
|
|
|
- run: cargo test --features=symphonia-all --all-targets
|
2021-03-29 07:20:48 +00:00
|
|
|
cargo-publish:
|
|
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
|
|
|
|
env:
|
|
|
|
CRATESIO_TOKEN: ${{ secrets.CRATESIO_TOKEN }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Update apt
|
|
|
|
run: sudo apt update
|
|
|
|
- name: Install alsa
|
2021-06-29 07:12:28 +00:00
|
|
|
run: sudo apt install -y --no-install-recommends libasound2-dev pkg-config
|
2021-03-29 07:20:48 +00:00
|
|
|
- name: Run cargo publish for rodio
|
|
|
|
continue-on-error: true
|
|
|
|
run: |
|
|
|
|
RODIO_TMP=$(mktemp /tmp/rodioXXX.txt) || echo "::error::mktemp error"
|
2021-03-29 07:26:54 +00:00
|
|
|
echo "RODIO_TMP=$RODIO_TMP" >> $GITHUB_ENV
|
2021-03-29 07:20:48 +00:00
|
|
|
cargo publish --token $CRATESIO_TOKEN 2> $RODIO_TMP
|
|
|
|
- name: Check if rodio is already published
|
|
|
|
run: |
|
|
|
|
empty=0
|
2021-03-29 07:26:54 +00:00
|
|
|
RODIO_TMP="${{ env.RODIO_TMP }}"
|
2021-03-29 07:20:48 +00:00
|
|
|
grep -q '[^[:space:]]' < $RODIO_TMP || empty=1
|
|
|
|
[ $empty -eq 0 ] && cat $RODIO_TMP
|
|
|
|
[ $empty -eq 1 ] || grep -q "is already uploaded" < $RODIO_TMP
|