1
0

main.yml 2.9 KB

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