main.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. args: --all --examples --tests
  44. test:
  45. if: github.event.pull_request.draft == false
  46. name: Test Suite
  47. runs-on: ubuntu-latest
  48. steps:
  49. - uses: actions/checkout@v2
  50. - uses: actions-rs/toolchain@v1
  51. with:
  52. profile: minimal
  53. toolchain: stable
  54. override: true
  55. - uses: Swatinem/rust-cache@v1
  56. - run: sudo apt-get update
  57. - run: sudo apt install libwebkit2gtk-4.0-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.3.0
  61. - uses: actions-rs/cargo@v1
  62. with:
  63. command: make
  64. args: tests
  65. fmt:
  66. if: github.event.pull_request.draft == false
  67. name: Rustfmt
  68. runs-on: ubuntu-latest
  69. steps:
  70. - uses: actions/checkout@v2
  71. - uses: actions-rs/toolchain@v1
  72. with:
  73. profile: minimal
  74. toolchain: stable
  75. override: true
  76. - uses: Swatinem/rust-cache@v1
  77. - run: rustup component add rustfmt
  78. - uses: actions-rs/cargo@v1
  79. with:
  80. command: fmt
  81. args: --all -- --check
  82. clippy:
  83. if: github.event.pull_request.draft == false
  84. name: Clippy
  85. runs-on: ubuntu-latest
  86. steps:
  87. - uses: actions/checkout@v2
  88. - uses: actions-rs/toolchain@v1
  89. with:
  90. profile: minimal
  91. toolchain: stable
  92. override: true
  93. - uses: Swatinem/rust-cache@v1
  94. - run: sudo apt-get update
  95. - run: sudo apt install libwebkit2gtk-4.0-dev libgtk-3-dev libayatana-appindicator3-dev
  96. - run: rustup component add clippy
  97. - uses: actions-rs/cargo@v1
  98. with:
  99. command: clippy
  100. args: -- -D warnings
  101. # Coverage is disabled until we can fix it
  102. # coverage:
  103. # name: Coverage
  104. # runs-on: ubuntu-latest
  105. # container:
  106. # image: xd009642/tarpaulin:develop-nightly
  107. # options: --security-opt seccomp=unconfined
  108. # steps:
  109. # - name: Checkout repository
  110. # uses: actions/checkout@v2
  111. # - name: Generate code coverage
  112. # run: |
  113. # apt-get update &&\
  114. # apt-get install build-essential &&\
  115. # apt install libwebkit2gtk-4.0-dev libgtk-3-dev libayatana-appindicator3-dev -y &&\
  116. # cargo +nightly tarpaulin --verbose --all-features --workspace --timeout 120 --out Xml
  117. # - name: Upload to codecov.io
  118. # uses: codecov/codecov-action@v2
  119. # with:
  120. # fail_ci_if_error: false