1
0

main.yml 2.9 KB

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