ci.yml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  1. name: CI
  2. on:
  3. push:
  4. branches: [main]
  5. pull_request:
  6. branches: [main]
  7. env:
  8. CARGO_TERM_COLOR: always
  9. jobs:
  10. self-care:
  11. name: Flake self-check
  12. runs-on: ubuntu-latest
  13. steps:
  14. - uses: actions/checkout@v4
  15. - name: Check Nix flake inputs
  16. uses: DeterminateSystems/flake-checker-action@v7
  17. with:
  18. fail-mode: true
  19. pre-commit-checks:
  20. name: "Pre-commit checks: cargo fmt, typos"
  21. runs-on: ubuntu-latest
  22. steps:
  23. - name: checkout
  24. uses: actions/checkout@v4
  25. - name: Install Nix
  26. uses: DeterminateSystems/nix-installer-action@v11
  27. - name: Nix Cache
  28. uses: DeterminateSystems/magic-nix-cache-action@v6
  29. - name: Rust Cache
  30. uses: Swatinem/rust-cache@v2
  31. - name: Pre-commit checks
  32. run: nix develop -i -L .#stable --command pre-commit run --all-files
  33. clippy:
  34. name: "Stable build, clippy and test"
  35. runs-on: ubuntu-latest
  36. strategy:
  37. matrix:
  38. build-args:
  39. [
  40. -p cdk,
  41. -p cdk --no-default-features,
  42. -p cdk --no-default-features --features wallet,
  43. -p cdk --no-default-features --features mint,
  44. -p cdk-redb,
  45. -p cdk-sqlite,
  46. -p cdk-axum,
  47. -p cdk-cln,
  48. -p cdk-lnd,
  49. -p cdk-phoenixd,
  50. -p cdk-strike,
  51. -p cdk-lnbits,
  52. -p cdk-fake-wallet,
  53. --bin cdk-cli,
  54. --bin cdk-mintd
  55. ]
  56. steps:
  57. - name: checkout
  58. uses: actions/checkout@v4
  59. - name: Install Nix
  60. uses: DeterminateSystems/nix-installer-action@v11
  61. - name: Nix Cache
  62. uses: DeterminateSystems/magic-nix-cache-action@v6
  63. - name: Rust Cache
  64. uses: Swatinem/rust-cache@v2
  65. - name: Build
  66. run: nix develop -i -L .#stable --command cargo build ${{ matrix.build-args }}
  67. - name: Clippy
  68. run: nix develop -i -L .#stable --command cargo clippy ${{ matrix.build-args }} -- -D warnings
  69. - name: Test
  70. run: nix develop -i -L .#stable --command cargo test ${{ matrix.build-args }}
  71. itest:
  72. name: "Integration tests"
  73. runs-on: ubuntu-latest
  74. strategy:
  75. matrix:
  76. build-args:
  77. [
  78. -p cdk-integration-tests,
  79. ]
  80. steps:
  81. - name: checkout
  82. uses: actions/checkout@v4
  83. - name: Install Nix
  84. uses: DeterminateSystems/nix-installer-action@v11
  85. - name: Nix Cache
  86. uses: DeterminateSystems/magic-nix-cache-action@v6
  87. - name: Rust Cache
  88. uses: Swatinem/rust-cache@v2
  89. - name: Clippy
  90. run: nix develop -i -L .#stable --command cargo clippy ${{ matrix.build-args }} -- -D warnings
  91. - name: Test
  92. run: nix develop -i -L .#stable --command just itest
  93. msrv-build:
  94. name: "MSRV build"
  95. runs-on: ubuntu-latest
  96. strategy:
  97. matrix:
  98. build-args:
  99. [
  100. -p cdk,
  101. -p cdk --no-default-features,
  102. -p cdk --no-default-features --features wallet,
  103. -p cdk --no-default-features --features mint,
  104. -p cdk-axum,
  105. -p cdk-strike,
  106. -p cdk-lnbits,
  107. -p cdk-phoenixd
  108. -p cdk-fake-wallet
  109. -p cdk-cln
  110. ]
  111. steps:
  112. - name: checkout
  113. uses: actions/checkout@v4
  114. - name: Install Nix
  115. uses: DeterminateSystems/nix-installer-action@v11
  116. - name: Nix Cache
  117. uses: DeterminateSystems/magic-nix-cache-action@v6
  118. - name: Rust Cache
  119. uses: Swatinem/rust-cache@v2
  120. - name: Build
  121. run: nix develop -i -L .#msrv --command cargo build ${{ matrix.build-args }}
  122. db-msrv-build:
  123. name: "DB MSRV build"
  124. runs-on: ubuntu-latest
  125. strategy:
  126. matrix:
  127. build-args:
  128. [
  129. -p cdk-sqlite
  130. -p cdk-redb
  131. ]
  132. steps:
  133. - name: checkout
  134. uses: actions/checkout@v4
  135. - name: Install Nix
  136. uses: DeterminateSystems/nix-installer-action@v11
  137. - name: Nix Cache
  138. uses: DeterminateSystems/magic-nix-cache-action@v6
  139. - name: Rust Cache
  140. uses: Swatinem/rust-cache@v2
  141. - name: Build
  142. run: nix develop -i -L .#db_shell --command cargo build ${{ matrix.build-args }}
  143. check-wasm:
  144. name: Check WASM
  145. runs-on: ubuntu-latest
  146. strategy:
  147. matrix:
  148. rust:
  149. - stable
  150. target:
  151. - wasm32-unknown-unknown
  152. build-args:
  153. [
  154. -p cdk,
  155. -p cdk --no-default-features,
  156. -p cdk --no-default-features --features wallet,
  157. -p cdk-js
  158. ]
  159. steps:
  160. - name: checkout
  161. uses: actions/checkout@v4
  162. - name: Install Nix
  163. uses: DeterminateSystems/nix-installer-action@v11
  164. - name: Nix Cache
  165. uses: DeterminateSystems/magic-nix-cache-action@v6
  166. - name: Rust Cache
  167. uses: Swatinem/rust-cache@v2
  168. - name: Build cdk and binding
  169. run: nix develop -i -L ".#${{ matrix.rust }}" --command cargo build ${{ matrix.build-args }} --target ${{ matrix.target }}
  170. check-wasm-msrv:
  171. name: Check WASM
  172. runs-on: ubuntu-latest
  173. strategy:
  174. matrix:
  175. rust:
  176. - msrv
  177. target:
  178. - wasm32-unknown-unknown
  179. build-args:
  180. [
  181. -p cdk,
  182. -p cdk --no-default-features,
  183. -p cdk --no-default-features --features wallet,
  184. ]
  185. steps:
  186. - name: checkout
  187. uses: actions/checkout@v4
  188. - name: Install Nix
  189. uses: DeterminateSystems/nix-installer-action@v11
  190. - name: Nix Cache
  191. uses: DeterminateSystems/magic-nix-cache-action@v6
  192. - name: Rust Cache
  193. uses: Swatinem/rust-cache@v2
  194. - name: Build cdk wasm
  195. run: nix develop -i -L ".#${{ matrix.rust }}" --command cargo build ${{ matrix.build-args }} --target ${{ matrix.target }}