main.yml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. if: github.event.pull_request.draft == false
  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. if: github.event.pull_request.draft == false
  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. if: github.event.pull_request.draft == false
  72. name: Clippy
  73. runs-on: ubuntu-latest
  74. steps:
  75. - uses: actions/checkout@v2
  76. - uses: actions-rs/toolchain@v1
  77. with:
  78. profile: minimal
  79. toolchain: stable
  80. override: true
  81. - uses: Swatinem/rust-cache@v1
  82. - run: sudo apt-get update
  83. - run: sudo apt install libwebkit2gtk-4.0-dev libappindicator3-dev libgtk-3-dev
  84. - run: rustup component add clippy
  85. - uses: actions-rs/cargo@v1
  86. with:
  87. command: clippy
  88. args: -- -D warnings
  89. # Coverage is disabled until we can fix it
  90. # coverage:
  91. # name: Coverage
  92. # runs-on: ubuntu-latest
  93. # container:
  94. # image: xd009642/tarpaulin:develop-nightly
  95. # options: --security-opt seccomp=unconfined
  96. # steps:
  97. # - name: Checkout repository
  98. # uses: actions/checkout@v2
  99. # - name: Generate code coverage
  100. # run: |
  101. # apt-get update &&\
  102. # apt-get install build-essential &&\
  103. # apt install libwebkit2gtk-4.0-dev libappindicator3-dev libgtk-3-dev -y &&\
  104. # cargo +nightly tarpaulin --verbose --all-features --workspace --timeout 120 --out Xml
  105. # - name: Upload to codecov.io
  106. # uses: codecov/codecov-action@v2
  107. # with:
  108. # fail_ci_if_error: false