summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-04-01 17:21:26 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-04-01 17:21:26 +0900
commitd5f672698004ae05f55e5e1f6a6e62a9cebbd530 (patch)
treed89b0a7e1eb3cbb4ad889c8ef3eca7ad73aec2ac
parent7388b83e7aac55ec7d8872ce58794b29b33c6522 (diff)
ci: add Gitea Actions workflow and CI script
-rw-r--r--.gitea/workflows/ci.yaml42
-rw-r--r--Makefile5
-rwxr-xr-xscripts/ci.sh15
3 files changed, 61 insertions, 1 deletions
diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml
new file mode 100644
index 0000000..ab7c1c5
--- /dev/null
+++ b/.gitea/workflows/ci.yaml
@@ -0,0 +1,42 @@
+name: CI
+
+on:
+ push:
+ branches: [master, main]
+ pull_request:
+ branches: [master, main]
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Set up Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: "3.12"
+
+ - name: Install dependencies
+ run: |
+ pip install -e shared/
+ pip install pytest pytest-asyncio ruff
+
+ - name: Lint
+ run: |
+ ruff check .
+ ruff format --check .
+
+ - name: Test
+ run: pytest -v
+
+ docker:
+ runs-on: ubuntu-latest
+ needs: test
+ if: github.ref == 'refs/heads/master'
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Build Docker images
+ run: |
+ docker compose build
diff --git a/Makefile b/Makefile
index e7878d6..4a41ebe 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-.PHONY: infra up down logs test lint format migrate migrate-down migrate-new
+.PHONY: infra up down logs test lint format migrate migrate-down migrate-new ci
infra:
docker compose up -d redis postgres
@@ -31,3 +31,6 @@ migrate-down:
migrate-new:
cd shared && alembic revision --autogenerate -m "$(msg)"
+
+ci:
+ ./scripts/ci.sh
diff --git a/scripts/ci.sh b/scripts/ci.sh
new file mode 100755
index 0000000..c89dd0d
--- /dev/null
+++ b/scripts/ci.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+echo "=== Installing dependencies ==="
+pip install -e shared/
+pip install pytest pytest-asyncio ruff
+
+echo "=== Linting ==="
+ruff check .
+ruff format --check .
+
+echo "=== Running tests ==="
+pytest -v
+
+echo "=== All checks passed ==="