ci.yml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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-integration-tests,
  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. msrv-build:
  73. name: "MSRV build"
  74. runs-on: ubuntu-latest
  75. strategy:
  76. matrix:
  77. build-args:
  78. [
  79. -p cdk,
  80. -p cdk --no-default-features,
  81. -p cdk --no-default-features --features wallet,
  82. -p cdk --no-default-features --features mint,
  83. -p cdk-axum,
  84. -p cdk-strike,
  85. -p cdk-lnbits,
  86. -p cdk-phoenixd
  87. -p cdk-fake-wallet
  88. -p cdk-cln
  89. ]
  90. steps:
  91. - name: checkout
  92. uses: actions/checkout@v4
  93. - name: Install Nix
  94. uses: DeterminateSystems/nix-installer-action@v11
  95. - name: Nix Cache
  96. uses: DeterminateSystems/magic-nix-cache-action@v6
  97. - name: Rust Cache
  98. uses: Swatinem/rust-cache@v2
  99. - name: Build
  100. run: nix develop -i -L .#msrv --command cargo build ${{ matrix.build-args }}
  101. db-msrv-build:
  102. name: "DB MSRV build"
  103. runs-on: ubuntu-latest
  104. strategy:
  105. matrix:
  106. build-args:
  107. [
  108. -p cdk-sqlite
  109. -p cdk-redb
  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 .#db_shell --command cargo build ${{ matrix.build-args }}
  122. check-wasm:
  123. name: Check WASM
  124. runs-on: ubuntu-latest
  125. strategy:
  126. matrix:
  127. rust:
  128. - stable
  129. target:
  130. - wasm32-unknown-unknown
  131. build-args:
  132. [
  133. -p cdk,
  134. -p cdk --no-default-features,
  135. -p cdk --no-default-features --features wallet,
  136. -p cdk-js
  137. ]
  138. steps:
  139. - name: checkout
  140. uses: actions/checkout@v4
  141. - name: Install Nix
  142. uses: DeterminateSystems/nix-installer-action@v11
  143. - name: Nix Cache
  144. uses: DeterminateSystems/magic-nix-cache-action@v6
  145. - name: Rust Cache
  146. uses: Swatinem/rust-cache@v2
  147. - name: Build cdk and binding
  148. run: nix develop -i -L ".#${{ matrix.rust }}" --command cargo build ${{ matrix.build-args }} --target ${{ matrix.target }}
  149. check-wasm-msrv:
  150. name: Check WASM
  151. runs-on: ubuntu-latest
  152. strategy:
  153. matrix:
  154. rust:
  155. - msrv
  156. target:
  157. - wasm32-unknown-unknown
  158. build-args:
  159. [
  160. -p cdk,
  161. -p cdk --no-default-features,
  162. -p cdk --no-default-features --features wallet,
  163. ]
  164. steps:
  165. - name: checkout
  166. uses: actions/checkout@v4
  167. - name: Install Nix
  168. uses: DeterminateSystems/nix-installer-action@v11
  169. - name: Nix Cache
  170. uses: DeterminateSystems/magic-nix-cache-action@v6
  171. - name: Rust Cache
  172. uses: Swatinem/rust-cache@v2
  173. - name: Build cdk wasm
  174. run: nix develop -i -L ".#${{ matrix.rust }}" --command cargo build ${{ matrix.build-args }} --target ${{ matrix.target }}