ci.yml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. name: CI
  2. on:
  3. push:
  4. branches: [master, main]
  5. pull_request:
  6. env:
  7. CARGO_TERM_COLOR: always
  8. RUSTFLAGS: -Dwarnings
  9. jobs:
  10. fmt:
  11. name: Format
  12. runs-on: ubuntu-latest
  13. steps:
  14. - uses: actions/checkout@v4
  15. - uses: dtolnay/rust-toolchain@stable
  16. with:
  17. components: rustfmt
  18. - run: cargo fmt --all --check
  19. clippy:
  20. name: Clippy
  21. runs-on: ubuntu-latest
  22. steps:
  23. - uses: actions/checkout@v4
  24. - uses: dtolnay/rust-toolchain@stable
  25. with:
  26. components: clippy
  27. - uses: Swatinem/rust-cache@v2
  28. - run: cargo clippy --all-targets --all-features
  29. doc:
  30. name: Docs
  31. runs-on: ubuntu-latest
  32. env:
  33. RUSTDOCFLAGS: -Dwarnings
  34. steps:
  35. - uses: actions/checkout@v4
  36. - uses: dtolnay/rust-toolchain@stable
  37. - uses: Swatinem/rust-cache@v2
  38. - run: cargo doc --workspace --all-features --no-deps
  39. test:
  40. name: Test (SQLite, i64)
  41. runs-on: ubuntu-latest
  42. steps:
  43. - uses: actions/checkout@v4
  44. - uses: dtolnay/rust-toolchain@stable
  45. - uses: Swatinem/rust-cache@v2
  46. # Default features: the SQLite backend with the i64 Cent backing.
  47. - run: cargo test --all
  48. test-i128:
  49. name: Test (i128 backing)
  50. runs-on: ubuntu-latest
  51. steps:
  52. - uses: actions/checkout@v4
  53. - uses: dtolnay/rust-toolchain@stable
  54. - uses: Swatinem/rust-cache@v2
  55. # Swap the Cent backing to i128 across the whole chain. Dashboard has no
  56. # i128 feature, so exclude it from the feature-scoped run.
  57. - run: cargo test --workspace --exclude kuatia-dashboard --features i128
  58. test-postgres:
  59. name: Test (PostgreSQL)
  60. runs-on: ubuntu-latest
  61. services:
  62. postgres:
  63. image: postgres:16
  64. env:
  65. POSTGRES_USER: kuatia
  66. POSTGRES_PASSWORD: kuatia
  67. POSTGRES_DB: kuatia
  68. ports:
  69. - 5432:5432
  70. options: >-
  71. --health-cmd "pg_isready -U kuatia"
  72. --health-interval 10s
  73. --health-timeout 5s
  74. --health-retries 5
  75. env:
  76. DATABASE_URL: postgres://kuatia:kuatia@localhost:5432/kuatia
  77. steps:
  78. - uses: actions/checkout@v4
  79. - uses: dtolnay/rust-toolchain@stable
  80. - uses: Swatinem/rust-cache@v2
  81. # Run only the SQL backend's conformance suite against real Postgres, so
  82. # the Postgres-only code paths (FOR UPDATE locks, ON CONFLICT) are covered.
  83. - run: cargo test -p kuatia-storage-sql --no-default-features --features test-postgres