Skip to content

docs: restructure documentation using Diataxis framework #372

docs: restructure documentation using Diataxis framework

docs: restructure documentation using Diataxis framework #372

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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install uv
uses: astral-sh/setup-uv@caf0cab7a618c569241d31dcd442f54681755d39 # v3.2.4
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@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install uv
uses: astral-sh/setup-uv@caf0cab7a618c569241d31dcd442f54681755d39 # v3.2.4
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"