1
0

main.yml 3.3 KB

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