Switch to uv #705
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
test-resonant-settings: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
# Tags are needed to compute the current version number | ||
fetch-depth: 0 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
enable-cache: true | ||
cache-dependency-glob: "django-resonant-settings/pyproject.toml" | ||
- name: Run tests | ||
run: | | ||
uvx tox | ||
working-directory: django-resonant-settings | ||
test-cookecutter: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
cookiecutter-variables: ["include_example_code=yes", "include_example_code=no"] | ||
services: | ||
postgres: | ||
image: postgres:alpine | ||
env: | ||
POSTGRES_DB: django | ||
POSTGRES_PASSWORD: postgres | ||
ports: | ||
- 5432:5432 | ||
rabbitmq: | ||
image: rabbitmq:management-alpine | ||
ports: | ||
- 5672:5672 | ||
minio: | ||
# This image does not require any command arguments (which GitHub Actions don't support) | ||
image: bitnami/minio:latest | ||
env: | ||
MINIO_ROOT_USER: minioAccessKey | ||
MINIO_ROOT_PASSWORD: minioSecretKey | ||
ports: | ||
- 9000:9000 | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
# Tags are needed to compute the current version number | ||
fetch-depth: 0 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
# There's no lockfile at this point | ||
enable-cache: false | ||
- name: Eject from cookiecutter | ||
run: | | ||
uvx cookiecutter --no-input . project_name=Resonant ${{ matrix.cookiecutter-variables }} | ||
- name: Run tox tests from new project | ||
run: | | ||
uvx tox | ||
env: | ||
DJANGO_DATABASE_URL: postgres://postgres:postgres@localhost:5432/django | ||
DJANGO_CELERY_BROKER_URL: amqp://localhost:5672/ | ||
DJANGO_MINIO_STORAGE_URL: http://minioAccessKey:minioSecretKey@localhost:9000/django-storage-testing | ||
# Ensure that the local django-resonant-settings (instead of the one on PyPI) is | ||
# installed for environments that install the project | ||
TOX_OVERRIDE: > | ||
testenv:test.deps+=${{ github.workspace }}/django-resonant-settings; | ||
testenv:check-migrations.deps+=${{ github.workspace }}/django-resonant-settings | ||
working-directory: resonant |