main.yml 2.8 KB

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