GRM-37: feat: Smart CI and release skipping for workflow-only changes

This commit is contained in:
emil
2026-06-21 20:15:28 +00:00
parent 6b3f2a5866
commit 56eb241b77
9 changed files with 540 additions and 15 deletions
+35 -4
View File
@@ -26,19 +26,41 @@ jobs:
run: |
. .venv/bin/activate
python3 scripts/check_test_speed.py --max-seconds 10
- name: Release dry-run validation
run: |
. .venv/bin/activate
PYTHONPATH=src python3 scripts/release.py --dry-run || true
- name: Documentation coverage check
run: |
. .venv/bin/activate
PYTHONPATH=src python3 scripts/doc_coverage.py
release-dry-run:
needs: [quality, detect-changes]
if: needs.detect-changes.outputs.user-facing-changed == 'true'
runs-on: docker
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up environment
run: make setup
- name: Install git-cliff
run: |
GIT_CLIFF_VERSION="2.13.0"
URL="https://github.com/orhun/git-cliff/releases/download/v${GIT_CLIFF_VERSION}/git-cliff-${GIT_CLIFF_VERSION}-x86_64-unknown-linux-gnu.tar.gz"
TMPDIR="$(mktemp -d)"
curl -sL "$URL" | tar xz -C "$TMPDIR"
mkdir -p "$HOME/.local/bin"
mv "$TMPDIR/git-cliff-${GIT_CLIFF_VERSION}/git-cliff" "$HOME/.local/bin/git-cliff"
chmod +x "$HOME/.local/bin/git-cliff"
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Release dry-run validation
run: |
. .venv/bin/activate
PYTHONPATH=src python3 scripts/release.py --dry-run || true
detect-changes:
runs-on: docker
outputs:
ansible-changed: ${{ steps.detect.outputs.ansible-changed }}
user-facing-changed: ${{ steps.detect.outputs.user-facing-changed }}
steps:
- uses: actions/checkout@v4
with:
@@ -62,6 +84,15 @@ jobs:
echo "ansible-changed=false" >> "$GITHUB_OUTPUT"
echo "No Ansible files changed — skipping molecule tests."
fi
# Check if any user-facing files changed (src/, ansible/, pyproject.toml)
USER_FACING=$(git diff --name-only "$BASE" "$HEAD" -- src/gitea_runner_manager/ ansible/ pyproject.toml 2>/dev/null | head -1)
if [ -n "$USER_FACING" ]; then
echo "user-facing-changed=true" >> "$GITHUB_OUTPUT"
echo "User-facing files changed — release dry-run will run."
else
echo "user-facing-changed=false" >> "$GITHUB_OUTPUT"
echo "No user-facing files changed — skipping release dry-run."
fi
molecule-tests:
needs: [quality, detect-changes]