diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 51a215c..3ac51a9 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -33,12 +33,20 @@ jobs: POSTGRES_USER: postgres POSTGRES_PASSWORD: pg_pwd OLLAMA_MODEL: tinydolphin:1.1b-v2.8-q4_0 - run: docker-compose up -d --build - - name: Debug - run: sleep 20 && docker-compose logs backend + run: docker compose up -d --build - name: Docker sanity check - run: nc -vz localhost 8050 - - name: Debug - run: docker-compose logs - - name: Ping server - run: curl http://localhost:8050/docs + env: + SUPERADMIN_GH_PAT: ${{ secrets.SUPERADMIN_GH_PAT }} + SUPERADMIN_LOGIN: dummy_login + SUPERADMIN_PWD: dummy_pwd + GH_OAUTH_ID: ${{ secrets.GH_OAUTH_ID }} + GH_OAUTH_SECRET: ${{ secrets.GH_OAUTH_SECRET }} + POSTGRES_DB: postgres + POSTGRES_USER: postgres + POSTGRES_PASSWORD: pg_pwd + OLLAMA_MODEL: tinydolphin:1.1b-v2.8-q4_0 + run: | + sleep 20 && docker compose logs backend + nc -vz localhost 8050 + docker compose logs + curl http://localhost:8050/docs diff --git a/.github/workflows/scripts.yml b/.github/workflows/scripts.yml index 6465013..150b1a6 100644 --- a/.github/workflows/scripts.yml +++ b/.github/workflows/scripts.yml @@ -32,8 +32,8 @@ jobs: run: sleep 20 && nc -vz localhost 8050 - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install "requests>=2.31.0,<3.0.0" python-dotenv + python -m pip install --upgrade uv + uv pip install --system "requests>=2.31.0,<3.0.0" python-dotenv - name: Run integration test env: SUPERUSER_LOGIN: ${{ secrets.SUPERUSER_LOGIN }} diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index c68cca1..93b89cf 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -15,8 +15,7 @@ jobs: python: [3.9] steps: - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} architecture: x64 @@ -25,15 +24,10 @@ jobs: poetry-version: "1.7.1" - name: Resolve dependencies run: poetry export -f requirements.txt --without-hashes --only quality --output requirements.txt - - name: Cache python modules - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-python-${{ matrix.python }}-${{ hashFiles('requirements.txt') }} - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install -r requirements.txt + python -m pip install --upgrade uv + uv pip install --system -r requirements.txt - name: Run ruff run: | ruff --version @@ -56,15 +50,10 @@ jobs: poetry-version: "1.7.1" - name: Resolve dependencies run: poetry export -f requirements.txt --without-hashes --with quality --output requirements.txt - - name: Cache python modules - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-python-${{ matrix.python }}-${{ hashFiles('requirements.txt') }} - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install -r requirements.txt + python -m pip install --upgrade uv + uv pip install --system -r requirements.txt - name: Run mypy run: | mypy --version @@ -78,8 +67,7 @@ jobs: python: [3.9] steps: - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 + - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python }} architecture: x64 @@ -88,15 +76,10 @@ jobs: poetry-version: "1.7.1" - name: Resolve dependencies run: poetry export -f requirements.txt --without-hashes --only quality --output requirements.txt - - name: Cache python modules - uses: actions/cache@v4 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-python-${{ matrix.python }}-${{ hashFiles('requirements.txt') }} - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install -r requirements.txt + python -m pip install --upgrade uv + uv pip install --system -r requirements.txt - name: Run ruff run: | ruff --version @@ -121,8 +104,8 @@ jobs: run: poetry export -f requirements.txt --without-hashes --only quality --output requirements.txt - name: Install dependencies run: | - python -m pip install --upgrade pip - pip install -r requirements.txt + python -m pip install --upgrade uv + uv pip install --system -r requirements.txt - name: Run pre-commit hooks run: | git checkout -b temp diff --git a/Dockerfile b/Dockerfile index 564f33b..0cd516d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,10 +12,11 @@ COPY requirements.txt /app/requirements.txt # install dependencies RUN set -eux \ - && pip install -r /app/requirements.txt \ - && rm -rf /root/.cache/pip + && pip install --no-cache-dir uv \ + && uv pip install --no-cache --system -r /app/requirements.txt \ + && rm -rf /root/.cache # copy project -COPY src/app /app/app -COPY src/alembic /app/alembic COPY src/alembic.ini /app/alembic.ini +COPY src/alembic /app/alembic +COPY src/app /app/app