main.yml 3.4 KB

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