Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
35 changes: 35 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "dataing Development",
"image": "mcr.microsoft.com/devcontainers/python:3.11",
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "20"
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
"postCreateCommand": "just setup",
"customizations": {
"vscode": {
"extensions": [
"charliermarsh.ruff",
"ms-python.mypy-type-checker",
"tamasfe.even-better-toml",
"ms-python.python",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"bradlc.vscode-tailwindcss"
],
"settings": {
"python.defaultInterpreterPath": "/usr/local/bin/python",
"python.linting.enabled": true,
"python.formatting.provider": "none",
"editor.formatOnSave": true,
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff"
}
}
}
},
"forwardPorts": [8000, 5173],
"remoteUser": "vscode"
}
67 changes: 67 additions & 0 deletions .github/workflows/ci-backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Backend CI

on:
push:
branches: [main]
paths:
- 'backend/**'
- 'pyproject.toml'
- '.github/workflows/ci-backend.yml'
pull_request:
branches: [main]
paths:
- 'backend/**'
- 'pyproject.toml'
- '.github/workflows/ci-backend.yml'

jobs:
test:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:15
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: test
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: uv sync --all-extras

- name: Run Ruff
run: uv run ruff check backend/

- name: Run mypy
run: uv run mypy backend/

- name: Run tests
run: uv run pytest --cov=backend/src/dataing --cov-report=xml
env:
DATABASE_URL: postgresql://test:test@localhost:5432/test

- name: Upload coverage
uses: codecov/codecov-action@v4
with:
files: coverage.xml
fail_ci_if_error: false
47 changes: 47 additions & 0 deletions .github/workflows/ci-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Frontend CI

on:
push:
branches: [main]
paths:
- 'frontend/**'
- '.github/workflows/ci-frontend.yml'
pull_request:
branches: [main]
paths:
- 'frontend/**'
- '.github/workflows/ci-frontend.yml'

jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
cache-dependency-path: frontend/pnpm-lock.yaml

- name: Install dependencies
run: cd frontend && pnpm install

- name: Run lint
run: cd frontend && pnpm lint

- name: Run type check
run: cd frontend && pnpm typecheck

- name: Run tests
run: cd frontend && pnpm test

- name: Build
run: cd frontend && pnpm build
84 changes: 84 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Release

on:
push:
branches: [main]
paths-ignore:
- 'docs/**'
- '*.md'

permissions:
contents: write
packages: write
id-token: write

jobs:
release:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 8

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install semantic-release
run: npm install -g semantic-release @semantic-release/git @semantic-release/changelog

- name: Semantic Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release

docker:
runs-on: ubuntu-latest
needs: release
if: github.ref == 'refs/heads/main'

steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push backend
uses: docker/build-push-action@v5
with:
context: .
file: infra/Dockerfile.backend
push: true
tags: |
ghcr.io/${{ github.repository }}/backend:latest
ghcr.io/${{ github.repository }}/backend:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build and push frontend
uses: docker/build-push-action@v5
with:
context: .
file: infra/Dockerfile.frontend
push: true
tags: |
ghcr.io/${{ github.repository }}/frontend:latest
ghcr.io/${{ github.repository }}/frontend:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
Loading
Loading