RobertCraigie / prisma-client-py

Prisma Client Python is an auto-generated and fully type-safe database client designed for ease of use
https://prisma-client-py.readthedocs.io
Apache License 2.0
1.83k stars 77 forks source link

Cache prisma engines in CI #550

Open RobertCraigie opened 1 year ago

RobertCraigie commented 1 year ago

We currently do not do any form of caching on the Prisma engine binaries, this would greatly improve CI times.

Leon0824 commented 1 year ago

You could make a cache in your CI pipeline configuration.

Here is an example for Drone CI.

pyproject.toml:

[tool.prisma]
# cache engine binaries in a directory relative to your project
binary_cache_dir = './prisma/binaries/' # Full path in CI runner: /drone/src/prisma/binaries/

.drone.yml

kind: pipeline
type: docker
name: default

volumes:
  - name: prisma
    host:
      path: /tmp/drone/cache/prisma/ # Cached files keep in CI runner host

steps:
  - name: test
    image: node:18-bullseye
    volumes:
      - name: prisma
        path: /drone/src/prisma/binaries/
    commands:
      - prisma migrate dev