test.yml 3.2 KB

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