diff --git a/.gitlab/.gitlab-ci.yml b/.gitlab/.gitlab-ci.yml index d7303d0..132028a 100644 --- a/.gitlab/.gitlab-ci.yml +++ b/.gitlab/.gitlab-ci.yml @@ -13,68 +13,52 @@ cache: .uv_setup: &uv_setup - curl -LsSf https://astral.sh/uv/install.sh | sh - - export PATH="$HOME/.cargo/bin:$PATH" - source $HOME/.local/bin/env workflow: rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - - if: $CI_COMMIT_TAG -# --- Data platform --- +# ── Tests ───────────────────────────────────────────────────────────────────── test:cli: stage: test before_script: - *uv_setup script: - - uv sync - - uv run pytest tests - rules: - - changes: - - src/**/* - - tests/**/* - - pyproject.toml + - uv sync --all-packages + - uv run pytest tests/ test:sqlmesh: stage: test before_script: - *uv_setup script: - - uv sync + - uv sync --all-packages - cd transform/sqlmesh_materia && uv run sqlmesh test - rules: - - changes: - - transform/**/* - -# --- Web app --- test:web: stage: test before_script: - *uv_setup script: - - uv sync + - uv sync --all-packages - cd web && uv run pytest tests/ -x -q - cd web && uv run ruff check src/ tests/ - rules: - - changes: - - web/**/* -# --- Deploy (pull-based via supervisor) --- -# The on-server supervisor (src/materia/supervisor.py) polls for new tags -# every 60s and deploys automatically when a new v tag appears. -# No SSH keys, no deploy credentials needed in CI. +# ── Tag (pull-based deploy) ─────────────────────────────────────────────────── +# Creates v tag after all tests pass. The on-server supervisor polls for new +# tags every 60s and deploys automatically. No SSH keys or deploy credentials +# needed in CI — only the built-in CI_JOB_TOKEN. tag: stage: tag image: alpine:latest - needs: [] before_script: - apk add --no-cache git script: - git tag "v${CI_PIPELINE_IID}" - git push "https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git" "v${CI_PIPELINE_IID}" rules: - - if: $CI_COMMIT_BRANCH == "master" + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH