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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 12 additions & 60 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,68 +1,20 @@
# Git相关
.git
.gitignore
.gitattributes

# Python缓存
__pycache__
*.pyc
*.pyo
*.pyd
.Python
*.so
.pytest_cache
.coverage

# 虚拟环境
.github
.venv
venv
env

# IDE文件
.vscode
.idea
*.swp
*.swo
*~

# 系统文件
.DS_Store
Thumbs.db

# 日志文件
*.log
logs/

# 配置文件(将通过挂载传入)
.ruff_cache
__pycache__
*.py[cod]
.env
.env.*
.secrets
config.toml
config/.env
src/config/roles.yaml

# 运行时数据绝不能进入镜像构建上下文
data/*
!data/init_db.sql
config/*
!config/config.example.toml
!config/Containerfile
data
logs
docs
*.db
*.db-*
*.sqlite
*.sqlite3

# 文档
docs/

# 测试文件
test/
tests/
*_test.py
test_*.py

# Docker相关
Dockerfile*
docker-compose*.yml
.dockerignore

# 其他
*.tmp
*.temp
.cache
*.log
2 changes: 0 additions & 2 deletions .env.example

This file was deleted.

66 changes: 14 additions & 52 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: CI

on:
push:
branches:
- main
branches: [main, "refactor/**"]
pull_request:
workflow_dispatch:
workflow_call:

permissions:
contents: read
Expand All @@ -15,59 +15,21 @@ concurrency:
cancel-in-progress: true

jobs:
tests:
name: Python tests
quality:
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Check out repository
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4

- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
with:
version: 0.11.19
enable-cache: true
cache-dependency-glob: uv.lock

- name: Install Python 3.13
run: uv python install 3.13

- name: Install locked dependencies
run: uv sync --frozen --dev

- name: Validate lock file
run: uv lock --check

- name: Compile Python sources
run: uv run python -m compileall -q main.py src scripts

- name: Run tests
run: uv run pytest -q

container-smoke:
name: Container smoke test (amd64)
needs: tests
runs-on: ubuntu-24.04
timeout-minutes: 90
steps:
- name: Check out repository
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4

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

- name: Build smoke-test image
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with:
context: .
load: true
platforms: linux/amd64
push: false
tags: al1s:ci-amd64
build-args: AL1S_VERSION=0.1.0
cache-from: type=gha,scope=ci-amd64
cache-to: type=gha,mode=max,scope=ci-amd64

- name: Run image smoke test
run: docker run --rm --platform linux/amd64 al1s:ci-amd64 python scripts/container_healthcheck.py --smoke
- run: uv python install 3.13
- run: uv sync --frozen --group dev --extra proxy
- run: uv lock --check
- run: >-
uv export --frozen --no-dev --extra proxy --extra workspace --no-emit-project
--format requirements-txt |
uvx --from pip-audit==2.10.1 pip-audit -r /dev/stdin
- run: uv run ruff format --check src
- run: uv run ruff check src
Loading
Loading