ci.yml 6.8 KB

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