main.yml 2.9 KB

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