rust.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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
  46. - name: Collect test coverage
  47. uses: actions-rs/tarpaulin@v0.1
  48. if: ${{ matrix.rust == 'stable' }}
  49. with:
  50. version: '0.16.0'
  51. out-type: Xml
  52. run-types: 'Tests'
  53. args: '--force-clean -- --test-threads 1'
  54. - name: Upload to codecov.io
  55. uses: codecov/codecov-action@v1.0.2
  56. if: ${{ matrix.rust == 'stable' }}
  57. with:
  58. token: ${{ secrets.CODECOV_SECRET }}
  59. - name: Archive code coverage results
  60. uses: actions/upload-artifact@v1
  61. if: ${{ matrix.rust == 'stable' }}
  62. with:
  63. name: code-coverage-report
  64. path: cobertura.xml
  65. - name: Archive build
  66. uses: actions/upload-artifact@v2
  67. with:
  68. name: receqif
  69. path: target/release/receqif