ci.yml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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-axum,
  140. -p cdk-strike,
  141. -p cdk-lnbits,
  142. -p cdk-phoenixd,
  143. -p cdk-fake-wallet,
  144. -p cdk-cln,
  145. ]
  146. steps:
  147. - name: checkout
  148. uses: actions/checkout@v4
  149. - name: Install Nix
  150. uses: DeterminateSystems/nix-installer-action@v11
  151. - name: Nix Cache
  152. uses: DeterminateSystems/magic-nix-cache-action@v6
  153. - name: Rust Cache
  154. uses: Swatinem/rust-cache@v2
  155. - name: Build
  156. run: nix develop -i -L .#msrv --command cargo build ${{ matrix.build-args }}
  157. db-msrv-build:
  158. name: "DB MSRV build"
  159. runs-on: ubuntu-latest
  160. strategy:
  161. matrix:
  162. build-args:
  163. [
  164. -p cdk-sqlite,
  165. -p cdk-redb,
  166. ]
  167. steps:
  168. - name: checkout
  169. uses: actions/checkout@v4
  170. - name: Install Nix
  171. uses: DeterminateSystems/nix-installer-action@v11
  172. - name: Nix Cache
  173. uses: DeterminateSystems/magic-nix-cache-action@v6
  174. - name: Rust Cache
  175. uses: Swatinem/rust-cache@v2
  176. - name: Build
  177. run: nix develop -i -L .#db_shell --command cargo build ${{ matrix.build-args }}
  178. check-wasm:
  179. name: Check WASM
  180. runs-on: ubuntu-latest
  181. strategy:
  182. matrix:
  183. rust:
  184. - stable
  185. target:
  186. - wasm32-unknown-unknown
  187. build-args:
  188. [
  189. -p cdk,
  190. -p cdk --no-default-features,
  191. -p cdk --no-default-features --features wallet,
  192. -p cdk-js,
  193. ]
  194. steps:
  195. - name: checkout
  196. uses: actions/checkout@v4
  197. - name: Install Nix
  198. uses: DeterminateSystems/nix-installer-action@v11
  199. - name: Nix Cache
  200. uses: DeterminateSystems/magic-nix-cache-action@v6
  201. - name: Rust Cache
  202. uses: Swatinem/rust-cache@v2
  203. - name: Build cdk and binding
  204. run: nix develop -i -L ".#${{ matrix.rust }}" --command cargo build ${{ matrix.build-args }} --target ${{ matrix.target }}
  205. check-wasm-msrv:
  206. name: Check WASM
  207. runs-on: ubuntu-latest
  208. strategy:
  209. matrix:
  210. rust:
  211. - msrv
  212. target:
  213. - wasm32-unknown-unknown
  214. build-args:
  215. [
  216. -p cdk,
  217. -p cdk --no-default-features,
  218. -p cdk --no-default-features --features wallet,
  219. ]
  220. steps:
  221. - name: checkout
  222. uses: actions/checkout@v4
  223. - name: Install Nix
  224. uses: DeterminateSystems/nix-installer-action@v11
  225. - name: Nix Cache
  226. uses: DeterminateSystems/magic-nix-cache-action@v6
  227. - name: Rust Cache
  228. uses: Swatinem/rust-cache@v2
  229. - name: Build cdk wasm
  230. run: nix develop -i -L ".#${{ matrix.rust }}" --command cargo build ${{ matrix.build-args }} --target ${{ matrix.target }}