Skip to content

build(deps): bump the uv group across 3 directories with 1 update #390

build(deps): bump the uv group across 3 directories with 1 update

build(deps): bump the uv group across 3 directories with 1 update #390

Workflow file for this run

permissions:
contents: read
name: build server
on:
pull_request:
paths:
- "carbonserver/**"
- "pyproject.toml"
push:
paths:
- "carbonserver/**"
- "pyproject.toml"
branches: [master]
jobs:
build_server:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
version: "latest"
- name: Set up Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --project carbonserver --extra dev
- name: Unit tests on api
run: uv run task test-api-unit
test_api_server:
runs-on: ubuntu-latest
permissions:
contents: read
# Service containers to run with `container-job`
services:
# Label used to access the service container
postgres:
# Docker Hub image
image: postgres:16
# Provide the password for postgres
env:
POSTGRES_DB: codecarbon_db
POSTGRES_PASSWORD: supersecret
POSTGRES_USER: codecarbon-user
POSTGRES_HOST: localhost
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5480:5432
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install uv
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
with:
version: "latest"
- name: Set up Python
run: uv python install 3.12
- name: Install dependencies
run: uv sync --project carbonserver --extra dev
- name: Setup database
env:
DATABASE_URL: postgresql://codecarbon-user:supersecret@localhost:5480/codecarbon_db
run: uv run task setup-db
- name: Integration tests on api
env:
CODECARBON_API_URL: http://localhost:8008
DATABASE_URL: postgresql://codecarbon-user:supersecret@localhost:5480/codecarbon_db
run: |
# uv run task dashboard-ci &
# sleep 10 # wait for server to start
# netstat -o -n -a | grep 8008
# uv run task test-api-integ
echo "Integration tests temporarily disabled - need to fix server startup"