rust.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. on: push
  2. name: CI Build
  3. jobs:
  4. ci:
  5. runs-on: ubuntu-latest
  6. strategy:
  7. matrix:
  8. rust:
  9. - stable
  10. - beta
  11. - nightly
  12. steps:
  13. - name: Checkout repository and submodules
  14. uses: actions/checkout@v2
  15. with:
  16. submodules: recursive
  17. - name: Install dependencies
  18. run: "sudo apt-get install libgpm-dev libncurses5-dev cmake"
  19. - name: Install toolchain
  20. uses: actions-rs/toolchain@v1
  21. with:
  22. profile: minimal
  23. toolchain: ${{ matrix.rust }}
  24. override: true
  25. components: rustfmt, clippy
  26. - name: Check formatting
  27. uses: actions-rs/cargo@v1
  28. with:
  29. command: fmt
  30. args: --all -- --check
  31. - name: Run static analyzer
  32. uses: actions-rs/cargo@v1
  33. with:
  34. command: clippy
  35. args: -- -D warnings
  36. - name: Build release version
  37. uses: actions-rs/cargo@v1
  38. with:
  39. command: build
  40. args: --release
  41. - name: Run tests
  42. uses: actions-rs/cargo@v1
  43. with:
  44. command: test
  45. args: --release --features monitoring
  46. env:
  47. RUST_BACKTRACE: 1
  48. - name: Collect test coverage
  49. uses: actions-rs/tarpaulin@v0.1
  50. if: ${{ matrix.rust == 'stable' }}
  51. with:
  52. version: '0.16.0'
  53. out-type: Xml
  54. run-types: 'Tests'
  55. args: '--force-clean --features monitoring -- --test-threads 1 '
  56. - name: Upload to codecov.io
  57. uses: codecov/codecov-action@v1.0.2
  58. if: ${{ matrix.rust == 'stable' }}
  59. with:
  60. token: ${{ secrets.CODECOV_SECRET }}
  61. - name: Archive code coverage results
  62. uses: actions/upload-artifact@v1
  63. if: ${{ matrix.rust == 'stable' }}
  64. with:
  65. name: code-coverage-report
  66. path: cobertura.xml
  67. - name: Archive build
  68. uses: actions/upload-artifact@v2
  69. with:
  70. name: receqif
  71. path: target/release/receqif