main.yml 3.5 KB

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