main.yml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. name: Main
  2. on:
  3. push:
  4. branches: [main]
  5. pull_request:
  6. jobs:
  7. format_and_lint_client_js:
  8. name: Format & Lint Client JS
  9. runs-on: ubuntu-latest
  10. steps:
  11. - name: Git Checkout
  12. uses: actions/checkout@v4
  13. - name: Setup Environment
  14. uses: ./.github/actions/setup
  15. - name: Format Client JS
  16. run: pnpm js:format
  17. - name: Lint Client JS
  18. run: pnpm js:lint
  19. format_and_lint_client_rust:
  20. name: Format & Lint Client Rust
  21. runs-on: ubuntu-latest
  22. steps:
  23. - name: Git Checkout
  24. uses: actions/checkout@v4
  25. - name: Setup Environment
  26. uses: ./.github/actions/setup
  27. with:
  28. toolchain: format, lint
  29. - name: Format
  30. run: pnpm rust:format
  31. - name: Lint / Clippy
  32. run: pnpm rust:lint:clippy
  33. - name: Lint / Docs
  34. run: pnpm rust:lint:docs
  35. - name: Lint / Features
  36. run: pnpm rust:lint:features
  37. format_and_lint_interface:
  38. name: Format & Lint Interface
  39. runs-on: ubuntu-latest
  40. steps:
  41. - name: Git Checkout
  42. uses: actions/checkout@v4
  43. - name: Setup Environment
  44. uses: ./.github/actions/setup
  45. with:
  46. toolchain: format, lint
  47. - name: Format
  48. run: pnpm interface:format
  49. - name: Lint / Clippy
  50. run: pnpm interface:lint:clippy
  51. - name: Lint / Docs
  52. run: pnpm interface:lint:docs
  53. - name: Lint / Features
  54. run: pnpm interface:lint:features
  55. format_and_lint_program:
  56. name: Format & Lint Program
  57. runs-on: ubuntu-latest
  58. steps:
  59. - name: Git Checkout
  60. uses: actions/checkout@v4
  61. - name: Setup Environment
  62. uses: ./.github/actions/setup
  63. with:
  64. toolchain: format, lint
  65. - name: Format
  66. run: pnpm program:format
  67. - name: Lint / Clippy
  68. run: pnpm program:lint:clippy
  69. - name: Lint / Docs
  70. run: pnpm program:lint:docs
  71. - name: Lint / Features
  72. run: pnpm program:lint:features
  73. wasm_interface:
  74. name: Build Interface in WASM
  75. runs-on: ubuntu-latest
  76. needs: format_and_lint_interface
  77. steps:
  78. - name: Git Checkout
  79. uses: actions/checkout@v4
  80. - name: Setup Environment
  81. uses: ./.github/actions/setup
  82. with:
  83. cargo-cache-key: cargo-wasm-interface
  84. solana: true
  85. - name: Install wasm-pack
  86. uses: taiki-e/install-action@v2
  87. with:
  88. tool: wasm-pack
  89. - name: Build Interface with wasm-pack
  90. run: pnpm interface:wasm
  91. test_interface:
  92. name: Test Interface
  93. runs-on: ubuntu-latest
  94. needs: format_and_lint_interface
  95. steps:
  96. - name: Git Checkout
  97. uses: actions/checkout@v4
  98. - name: Setup Environment
  99. uses: ./.github/actions/setup
  100. with:
  101. toolchain: test
  102. cargo-cache-key: cargo-interface
  103. solana: true
  104. - name: Test Interface
  105. run: pnpm interface:test
  106. generate_clients:
  107. name: Check Client Generation
  108. runs-on: ubuntu-latest
  109. steps:
  110. - name: Git Checkout
  111. uses: actions/checkout@v4
  112. - name: Setup Environment
  113. uses: ./.github/actions/setup
  114. with:
  115. toolchain: format
  116. - name: Generate Clients
  117. run: pnpm generate:clients
  118. - name: Check Working Directory
  119. run: |
  120. git status --porcelain
  121. test -z "$(git status --porcelain)"
  122. build_program:
  123. name: Build Program
  124. runs-on: ubuntu-latest
  125. needs: format_and_lint_program
  126. steps:
  127. - name: Git Checkout
  128. uses: actions/checkout@v4
  129. - name: Setup Environment
  130. uses: ./.github/actions/setup
  131. with:
  132. cargo-cache-key: cargo-build-program
  133. solana: true
  134. - name: Build
  135. run: pnpm program:build
  136. - name: Upload Program Builds
  137. uses: actions/upload-artifact@v4
  138. with:
  139. name: program-builds
  140. path: ./target/deploy/*.so
  141. if-no-files-found: error
  142. - name: Save Program Builds For Client Jobs
  143. uses: actions/cache/save@v4
  144. with:
  145. path: ./**/*.so
  146. key: ${{ runner.os }}-builds-${{ github.sha }}
  147. test_client_js:
  148. name: Test Client JS
  149. runs-on: ubuntu-latest
  150. needs: [format_and_lint_client_js, build_program]
  151. steps:
  152. - name: Git Checkout
  153. uses: actions/checkout@v4
  154. - name: Setup Environment
  155. uses: ./.github/actions/setup
  156. with:
  157. solana: true
  158. - name: Restore Program Builds
  159. uses: actions/cache/restore@v4
  160. with:
  161. path: ./**/*.so
  162. key: ${{ runner.os }}-builds-${{ github.sha }}
  163. - name: Test Client JS
  164. run: pnpm js:test
  165. test_client_rust:
  166. name: Test Client Rust
  167. runs-on: ubuntu-latest
  168. needs: [format_and_lint_client_rust, build_program]
  169. steps:
  170. - name: Git Checkout
  171. uses: actions/checkout@v4
  172. - name: Setup Environment
  173. uses: ./.github/actions/setup
  174. with:
  175. cargo-cache-key: cargo-rust-client
  176. toolchain: test
  177. solana: true
  178. - name: Restore Program Builds
  179. uses: actions/cache/restore@v4
  180. with:
  181. path: ./**/*.so
  182. key: ${{ runner.os }}-builds-${{ github.sha }}
  183. - name: Test Client Rust
  184. run: pnpm rust:test
  185. test_program:
  186. name: Test Program
  187. runs-on: ubuntu-latest
  188. needs: build_program
  189. steps:
  190. - name: Git Checkout
  191. uses: actions/checkout@v4
  192. - name: Setup Environment
  193. uses: ./.github/actions/setup
  194. with:
  195. cargo-cache-key: cargo-program-tests
  196. toolchain: test
  197. solana: true
  198. - name: Restore Program Builds
  199. uses: actions/cache/restore@v4
  200. with:
  201. path: ./**/*.so
  202. key: ${{ runner.os }}-builds-${{ github.sha }}
  203. - name: Test
  204. run: pnpm program:test