ci.yml (2423B)
1 name: CI 2 3 on: 4 pull_request: 5 push: 6 7 jobs: 8 test: 9 strategy: 10 matrix: 11 os: [windows-latest, ubuntu-latest, macos-latest] 12 runs-on: ${{ matrix.os }} 13 steps: 14 - uses: actions/checkout@v2 15 - uses: actions/cache@v2 16 with: 17 path: | 18 ~/.cargo/bin/ 19 ~/.cargo/registry/index/ 20 ~/.cargo/registry/cache/ 21 ~/.cargo/git/db/ 22 target/ 23 key: ${{ runner.os }}-cargo-build-stable-${{ hashFiles('**/Cargo.toml') }} 24 - uses: actions-rs/toolchain@v1 25 with: 26 toolchain: stable 27 override: true 28 - name: Install alsa and udev 29 run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev 30 if: runner.os == 'linux' 31 - name: Build & run tests 32 run: cargo test 33 all-doc-tests: 34 runs-on: ubuntu-latest 35 steps: 36 - uses: actions/checkout@v2 37 - uses: actions/cache@v2 38 with: 39 path: | 40 ~/.cargo/bin/ 41 ~/.cargo/registry/index/ 42 ~/.cargo/registry/cache/ 43 ~/.cargo/git/db/ 44 target/ 45 key: ubuntu-latest-cargo-build-stable-${{ hashFiles('**/Cargo.toml') }} 46 - uses: actions-rs/toolchain@v1 47 with: 48 toolchain: stable 49 override: true 50 - name: Install alsa and udev 51 run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev 52 - name: Run doc tests with all features (this also compiles README examples) 53 run: cargo test --doc --all-features 54 lint: 55 runs-on: ubuntu-latest 56 steps: 57 - uses: actions/checkout@v2 58 - uses: actions/cache@v2 59 with: 60 path: | 61 ~/.cargo/bin/ 62 ~/.cargo/registry/index/ 63 ~/.cargo/registry/cache/ 64 ~/.cargo/git/db/ 65 target/ 66 key: ubuntu-latest-cargo-build-stable-${{ hashFiles('**/Cargo.toml') }} 67 - uses: actions-rs/toolchain@v1 68 with: 69 toolchain: stable 70 components: rustfmt, clippy 71 override: true 72 - name: Install alsa and udev 73 run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev 74 - name: Run clippy 75 run: cargo clippy --workspace --all-targets --all-features 76 - name: Check format 77 run: cargo fmt --all -- --check