65 lines
2.0 KiB
YAML
65 lines
2.0 KiB
YAML
name: ci
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
- main
|
|
pull_request:
|
|
|
|
env:
|
|
REGISTRY: gitea.rclaw.top
|
|
IMAGE_NAMESPACE: linkong/planet
|
|
|
|
jobs:
|
|
backend:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install uv
|
|
run: curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
- name: Sync Python dependencies
|
|
run: ~/.local/bin/uv sync --group dev
|
|
- name: Run backend smoke tests
|
|
working-directory: backend
|
|
run: PYTHONPATH=. "$GITHUB_WORKSPACE/.venv/bin/python" -m pytest -s tests/test_api.py tests/test_realtime_sources.py -q
|
|
|
|
frontend:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install Bun
|
|
run: curl -fsSL https://bun.sh/install | bash
|
|
- name: Build frontend
|
|
working-directory: frontend
|
|
run: |
|
|
~/.bun/bin/bun install --frozen-lockfile
|
|
~/.bun/bin/bun run build
|
|
|
|
delivery:
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- backend
|
|
- frontend
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install Helm
|
|
run: |
|
|
mkdir -p "$HOME/.local/bin"
|
|
curl -fsSL https://get.helm.sh/helm-v3.15.4-linux-amd64.tar.gz -o /tmp/helm.tar.gz
|
|
tar -xzf /tmp/helm.tar.gz -C /tmp
|
|
mv /tmp/linux-amd64/helm "$HOME/.local/bin/helm"
|
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
- name: Docker build smoke
|
|
run: |
|
|
docker build -t "$REGISTRY/$IMAGE_NAMESPACE/frontend:${GITHUB_SHA}" ./frontend
|
|
docker build -t "$REGISTRY/$IMAGE_NAMESPACE/backend:${GITHUB_SHA}" -f backend/Dockerfile .
|
|
docker build -t "$REGISTRY/$IMAGE_NAMESPACE/aiprovider:${GITHUB_SHA}" -f aiprovider/Dockerfile .
|
|
- name: Helm template smoke
|
|
run: |
|
|
helm lint deploy/helm/planet
|
|
helm template planet-staging deploy/helm/planet \
|
|
--namespace planet-staging \
|
|
-f deploy/helm/planet/values.single-node.yaml \
|
|
--set image.tag="${GITHUB_SHA}" >/tmp/planet-rendered.yaml
|