main.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. name: Rust CI
  2. on:
  3. push:
  4. paths:
  5. - packages
  6. - examples
  7. - src
  8. - lib.rs
  9. - Cargo.toml
  10. - .github
  11. pull_request:
  12. jobs:
  13. check:
  14. name: Check
  15. runs-on: ubuntu-latest
  16. steps:
  17. - uses: actions/checkout@v2
  18. - uses: actions-rs/toolchain@v1
  19. with:
  20. profile: minimal
  21. toolchain: stable
  22. override: true
  23. - uses: Swatinem/rust-cache@v1
  24. - run: sudo apt-get update
  25. - run: sudo apt install libwebkit2gtk-4.0-dev libappindicator3-dev libgtk-3-dev
  26. - uses: actions-rs/cargo@v1
  27. with:
  28. command: check
  29. test:
  30. name: Test Suite
  31. runs-on: ubuntu-latest
  32. steps:
  33. - uses: actions/checkout@v2
  34. - uses: actions-rs/toolchain@v1
  35. with:
  36. profile: minimal
  37. toolchain: stable
  38. override: true
  39. - uses: Swatinem/rust-cache@v1
  40. - run: sudo apt-get update
  41. - run: sudo apt install libwebkit2gtk-4.0-dev libappindicator3-dev libgtk-3-dev
  42. - uses: davidB/rust-cargo-make@v1
  43. - uses: browser-actions/setup-firefox@latest
  44. - uses: jetli/wasm-pack-action@v0.3.0
  45. - uses: actions-rs/cargo@v1
  46. with:
  47. command: make
  48. args: tests
  49. fmt:
  50. name: Rustfmt
  51. runs-on: ubuntu-latest
  52. steps:
  53. - uses: actions/checkout@v2
  54. - uses: actions-rs/toolchain@v1
  55. with:
  56. profile: minimal
  57. toolchain: stable
  58. override: true
  59. - uses: Swatinem/rust-cache@v1
  60. - run: rustup component add rustfmt
  61. - uses: actions-rs/cargo@v1
  62. with:
  63. command: fmt
  64. args: --all -- --check
  65. clippy:
  66. name: Clippy
  67. runs-on: ubuntu-latest
  68. steps:
  69. - uses: actions/checkout@v2
  70. - uses: actions-rs/toolchain@v1
  71. with:
  72. profile: minimal
  73. toolchain: stable
  74. override: true
  75. - uses: Swatinem/rust-cache@v1
  76. - run: sudo apt-get update
  77. - run: sudo apt install libwebkit2gtk-4.0-dev libappindicator3-dev libgtk-3-dev
  78. - run: rustup component add clippy
  79. - uses: actions-rs/cargo@v1
  80. with:
  81. command: clippy
  82. args: -- -D warnings
  83. coverage:
  84. name: Coverage
  85. runs-on: ubuntu-latest
  86. container:
  87. image: xd009642/tarpaulin:develop-nightly
  88. options: --security-opt seccomp=unconfined
  89. steps:
  90. - name: Checkout repository
  91. uses: actions/checkout@v2
  92. - name: Generate code coverage
  93. run: |
  94. apt-get update &&\
  95. apt install libwebkit2gtk-4.0-dev libappindicator3-dev libgtk-3-dev -y &&\
  96. cargo +nightly tarpaulin --verbose --tests --all-features --workspace --timeout 120 --out Xml
  97. - name: Upload to codecov.io
  98. uses: codecov/codecov-action@v2