test.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. # Note, this is used in the badge URL!
  2. name: test
  3. on:
  4. push:
  5. branches: [master, dev]
  6. paths: ['**.rs', '**.toml', '**.lock', '**.yml']
  7. pull_request:
  8. branches: [master, dev]
  9. paths: ['**.rs', '**.toml', '**.lock', '**.yml']
  10. jobs:
  11. fmt:
  12. name: 'Rust: format check'
  13. runs-on: ${{ matrix.os }}
  14. strategy:
  15. fail-fast: false
  16. matrix:
  17. # Only run the formatting check for stable
  18. include:
  19. - os: ubuntu-latest
  20. toolchain: stable
  21. steps:
  22. - name: Checkout code
  23. uses: actions/checkout@v2
  24. - name: Install toolchain
  25. uses: actions-rs/toolchain@v1
  26. with:
  27. # Use default profile to get rustfmt
  28. profile: default
  29. toolchain: ${{ matrix.toolchain }}
  30. override: true
  31. - run: cargo fmt --verbose --all -- --check
  32. test:
  33. needs: fmt
  34. runs-on: ${{ matrix.os }}
  35. continue-on-error: ${{ matrix.experimental }}
  36. strategy:
  37. fail-fast: false
  38. matrix:
  39. os: [ubuntu-latest]
  40. toolchain:
  41. - 1.40.0 # MSRV (Minimum supported rust version)
  42. - stable
  43. - beta
  44. experimental: [false]
  45. # Ignore failures in nightly, not ideal, but necessary
  46. include:
  47. - os: ubuntu-latest
  48. toolchain: nightly
  49. experimental: true
  50. steps:
  51. - name: Checkout code
  52. uses: actions/checkout@v2
  53. - name: Install toolchain
  54. uses: actions-rs/toolchain@v1
  55. with:
  56. profile: minimal
  57. toolchain: ${{ matrix.toolchain }}
  58. override: true
  59. - name: Install developer package dependencies
  60. run: sudo apt-get update && sudo apt-get install libpulse-dev portaudio19-dev libasound2-dev libsdl2-dev gstreamer1.0-dev libgstreamer-plugins-base1.0-dev
  61. - run: cargo build --locked --no-default-features
  62. - run: cargo build --locked --examples
  63. - run: cargo build --locked --no-default-features --features "with-tremor"
  64. - run: cargo build --locked --no-default-features --features "with-vorbis"
  65. - run: cargo build --locked --no-default-features --features "alsa-backend"
  66. - run: cargo build --locked --no-default-features --features "portaudio-backend"
  67. - run: cargo build --locked --no-default-features --features "pulseaudio-backend"
  68. - run: cargo build --locked --no-default-features --features "jackaudio-backend"
  69. - run: cargo build --locked --no-default-features --features "rodio-backend"
  70. - run: cargo build --locked --no-default-features --features "sdl-backend"
  71. - run: cargo build --locked --no-default-features --features "gstreamer-backend"
  72. test-cross-arm:
  73. needs: fmt
  74. runs-on: ${{ matrix.os }}
  75. continue-on-error: false
  76. strategy:
  77. fail-fast: false
  78. matrix:
  79. include:
  80. - os: ubuntu-latest
  81. target: armv7-unknown-linux-gnueabihf
  82. toolchain: stable
  83. steps:
  84. - name: Checkout code
  85. uses: actions/checkout@v2
  86. - name: Install toolchain
  87. uses: actions-rs/toolchain@v1
  88. with:
  89. profile: minimal
  90. target: ${{ matrix.target }}
  91. toolchain: ${{ matrix.toolchain }}
  92. override: true
  93. - name: Install cross
  94. run: cargo install cross || true
  95. - name: Build
  96. run: cross build --locked --target ${{ matrix.target }} --no-default-features