ci.yml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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 --no-default-features --features "mint swagger",
  45. -p cdk-redb,
  46. -p cdk-sqlite,
  47. -p cdk-axum,
  48. -p cdk-cln,
  49. -p cdk-lnd,
  50. -p cdk-phoenixd,
  51. -p cdk-strike,
  52. -p cdk-lnbits,
  53. -p cdk-fake-wallet,
  54. --bin cdk-cli,
  55. --bin cdk-mintd,
  56. ]
  57. steps:
  58. - name: checkout
  59. uses: actions/checkout@v4
  60. - name: Install Nix
  61. uses: DeterminateSystems/nix-installer-action@v11
  62. - name: Nix Cache
  63. uses: DeterminateSystems/magic-nix-cache-action@v6
  64. - name: Rust Cache
  65. uses: Swatinem/rust-cache@v2
  66. - name: Build
  67. run: nix develop -i -L .#stable --command cargo build ${{ matrix.build-args }}
  68. - name: Clippy
  69. run: nix develop -i -L .#stable --command cargo clippy ${{ matrix.build-args }} -- -D warnings
  70. - name: Test
  71. run: nix develop -i -L .#stable --command cargo test ${{ matrix.build-args }}
  72. itest:
  73. name: "Integration regtest tests"
  74. runs-on: ubuntu-latest
  75. strategy:
  76. matrix:
  77. build-args:
  78. [
  79. -p cdk-integration-tests,
  80. ]
  81. database:
  82. [
  83. REDB,
  84. SQLITE,
  85. MEMORY,
  86. ]
  87. steps:
  88. - name: checkout
  89. uses: actions/checkout@v4
  90. - name: Install Nix
  91. uses: DeterminateSystems/nix-installer-action@v11
  92. - name: Nix Cache
  93. uses: DeterminateSystems/magic-nix-cache-action@v6
  94. - name: Rust Cache
  95. uses: Swatinem/rust-cache@v2
  96. - name: Clippy
  97. run: nix develop -i -L .#stable --command cargo clippy ${{ matrix.build-args }} -- -D warnings
  98. - name: Test
  99. run: nix develop -i -L .#stable --command just itest ${{ matrix.database }}
  100. fake-wallet-itest:
  101. name: "Integration fake wallet tests"
  102. runs-on: ubuntu-latest
  103. strategy:
  104. matrix:
  105. build-args:
  106. [
  107. -p cdk-integration-tests,
  108. ]
  109. database:
  110. [
  111. REDB,
  112. SQLITE,
  113. MEMORY,
  114. ]
  115. steps:
  116. - name: checkout
  117. uses: actions/checkout@v4
  118. - name: Install Nix
  119. uses: DeterminateSystems/nix-installer-action@v11
  120. - name: Nix Cache
  121. uses: DeterminateSystems/magic-nix-cache-action@v6
  122. - name: Rust Cache
  123. uses: Swatinem/rust-cache@v2
  124. - name: Clippy
  125. run: nix develop -i -L .#stable --command cargo clippy ${{ matrix.build-args }} -- -D warnings
  126. - name: Test fake mint
  127. run: nix develop -i -L .#stable --command just fake-mint-itest ${{ matrix.database }}
  128. msrv-build:
  129. name: "MSRV build"
  130. runs-on: ubuntu-latest
  131. strategy:
  132. matrix:
  133. build-args:
  134. [
  135. -p cdk,
  136. -p cdk --no-default-features,
  137. -p cdk --no-default-features --features wallet,
  138. -p cdk --no-default-features --features mint,
  139. -p cdk --no-default-features --features "mint swagger",
  140. -p cdk-axum,
  141. -p cdk-strike,
  142. -p cdk-lnbits,
  143. -p cdk-phoenixd,
  144. -p cdk-fake-wallet,
  145. -p cdk-cln,
  146. ]
  147. steps:
  148. - name: checkout
  149. uses: actions/checkout@v4
  150. - name: Install Nix
  151. uses: DeterminateSystems/nix-installer-action@v11
  152. - name: Nix Cache
  153. uses: DeterminateSystems/magic-nix-cache-action@v6
  154. - name: Rust Cache
  155. uses: Swatinem/rust-cache@v2
  156. - name: Build
  157. run: nix develop -i -L .#msrv --command cargo build ${{ matrix.build-args }}
  158. db-msrv-build:
  159. name: "DB MSRV build"
  160. runs-on: ubuntu-latest
  161. strategy:
  162. matrix:
  163. build-args:
  164. [
  165. -p cdk-sqlite,
  166. -p cdk-redb,
  167. ]
  168. steps:
  169. - name: checkout
  170. uses: actions/checkout@v4
  171. - name: Install Nix
  172. uses: DeterminateSystems/nix-installer-action@v11
  173. - name: Nix Cache
  174. uses: DeterminateSystems/magic-nix-cache-action@v6
  175. - name: Rust Cache
  176. uses: Swatinem/rust-cache@v2
  177. - name: Build
  178. run: nix develop -i -L .#db_shell --command cargo build ${{ matrix.build-args }}
  179. check-wasm:
  180. name: Check WASM
  181. runs-on: ubuntu-latest
  182. strategy:
  183. matrix:
  184. rust:
  185. - stable
  186. target:
  187. - wasm32-unknown-unknown
  188. build-args:
  189. [
  190. -p cdk,
  191. -p cdk --no-default-features,
  192. -p cdk --no-default-features --features wallet,
  193. -p cdk-js,
  194. ]
  195. steps:
  196. - name: checkout
  197. uses: actions/checkout@v4
  198. - name: Install Nix
  199. uses: DeterminateSystems/nix-installer-action@v11
  200. - name: Nix Cache
  201. uses: DeterminateSystems/magic-nix-cache-action@v6
  202. - name: Rust Cache
  203. uses: Swatinem/rust-cache@v2
  204. - name: Build cdk and binding
  205. run: nix develop -i -L ".#${{ matrix.rust }}" --command cargo build ${{ matrix.build-args }} --target ${{ matrix.target }}
  206. check-wasm-msrv:
  207. name: Check WASM
  208. runs-on: ubuntu-latest
  209. strategy:
  210. matrix:
  211. rust:
  212. - msrv
  213. target:
  214. - wasm32-unknown-unknown
  215. build-args:
  216. [
  217. -p cdk,
  218. -p cdk --no-default-features,
  219. -p cdk --no-default-features --features wallet,
  220. ]
  221. steps:
  222. - name: checkout
  223. uses: actions/checkout@v4
  224. - name: Install Nix
  225. uses: DeterminateSystems/nix-installer-action@v11
  226. - name: Nix Cache
  227. uses: DeterminateSystems/magic-nix-cache-action@v6
  228. - name: Rust Cache
  229. uses: Swatinem/rust-cache@v2
  230. - name: Build cdk wasm
  231. run: nix develop -i -L ".#${{ matrix.rust }}" --command cargo build ${{ matrix.build-args }} --target ${{ matrix.target }}