ci.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. fmt:
  11. name: Format
  12. runs-on: ubuntu-latest
  13. steps:
  14. - uses: actions/checkout@v3
  15. - run: cargo fmt --all -- --config format_code_in_doc_comments=true --check
  16. build:
  17. name: Build
  18. runs-on: ubuntu-latest
  19. strategy:
  20. matrix:
  21. rust:
  22. - version: stable
  23. build-args:
  24. [
  25. -p cdk,
  26. -p cdk --no-default-features,
  27. -p cdk --no-default-features --features wallet,
  28. -p cdk --no-default-features --features mint,
  29. -p cdk-redb,
  30. -p cdk-sqlite,
  31. -p cdk-axum,
  32. -p cdk-cln,
  33. -p cdk-fake-wallet,
  34. -p cdk-strike,
  35. -p cdk-integration-tests,
  36. --bin cdk-cli,
  37. --bin cdk-mintd,
  38. ]
  39. steps:
  40. - name: Checkout
  41. uses: actions/checkout@v3
  42. - name: Cache
  43. uses: actions/cache@v3
  44. with:
  45. path: |
  46. ~/.cargo/registry
  47. ~/.cargo/git
  48. target
  49. key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
  50. - name: Set default toolchain
  51. run: rustup default ${{ matrix.rust.version }}
  52. - name: Set profile
  53. run: rustup set profile minimal && rustup component add clippy
  54. - name: Build
  55. run: cargo build ${{ matrix.build-args }}
  56. - name: Clippy
  57. run: cargo clippy ${{ matrix.build-args }} -- -D warnings
  58. build-wasm:
  59. name: Build WASM
  60. runs-on: ubuntu-latest
  61. strategy:
  62. matrix:
  63. rust:
  64. - version: stable
  65. build-args:
  66. [
  67. -p cdk,
  68. -p cdk --no-default-features,
  69. -p cdk --no-default-features --features wallet,
  70. -p cdk-js
  71. ]
  72. steps:
  73. - name: Checkout
  74. uses: actions/checkout@v3
  75. - name: Cache
  76. uses: actions/cache@v3
  77. with:
  78. path: |
  79. ~/.cargo/registry
  80. ~/.cargo/git
  81. target
  82. key: ${{ runner.os }}-cargo-wasm32-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
  83. - name: Set default toolchain
  84. run: rustup default ${{ matrix.rust.version }}
  85. - name: Add WASM
  86. run: rustup target add wasm32-unknown-unknown
  87. - name: Set profile
  88. run: rustup set profile minimal && rustup component add clippy
  89. - name: Build
  90. run: cargo build ${{ matrix.build-args }} --target wasm32-unknown-unknown
  91. - name: Clippy
  92. run: cargo clippy ${{ matrix.build-args }} --target wasm32-unknown-unknown -- -D warnings
  93. run-examples:
  94. name: Run Examples
  95. runs-on: ubuntu-latest
  96. strategy:
  97. matrix:
  98. rust:
  99. - version: stable
  100. build-args:
  101. [
  102. mint-token,
  103. p2pk,
  104. proof-selection,
  105. wallet
  106. ]
  107. steps:
  108. - name: Checkout
  109. uses: actions/checkout@v3
  110. - name: Cache
  111. uses: actions/cache@v3
  112. with:
  113. path: |
  114. ~/.cargo/registry
  115. ~/.cargo/git
  116. target
  117. key: ${{ runner.os }}-cargo-wasm32-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
  118. - name: Set default toolchain
  119. run: rustup default ${{ matrix.rust.version }}
  120. - name: Run
  121. run: cargo run --example ${{ matrix.build-args }}