plugin-barman-cloud/.github/workflows/ci.yml
Marco Nenciarini 2e12c08121
ci: deep forensic probe of .git snapshot integrity under load
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
2026-06-07 00:52:54 +02:00

92 lines
3.3 KiB
YAML

name: CI
on:
pull_request:
workflow_dispatch:
permissions: read-all
jobs:
ci:
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
steps:
- name: Cleanup Disk
uses: jlumbroso/free-disk-space@v1.3.1
with:
android: true
dotnet: true
haskell: true
tool-cache: true
large-packages: false
swap-storage: false
- name: Cleanup docker cache
run: |
echo "-------------Disk info before cleanup----------------"
df -h
echo "-----------------------------------------------------"
docker system prune -a -f
echo "-------------Disk info after cleanup----------------"
df -h
echo "-----------------------------------------------------"
- name: Checkout
uses: actions/checkout@v6
# We need the full history for the commitlint task
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Install QEMU static binaries
uses: docker/setup-qemu-action@v4
- name: Install Task
uses: arduino/setup-task@v2
- name: Install Dagger
env:
# renovate: datasource=github-tags depName=dagger/dagger versioning=semver
DAGGER_VERSION: 0.21.4
run: |
curl -L https://dl.dagger.io/dagger/install.sh | BIN_DIR=$HOME/.local/bin sh
- name: Run CI task
env:
GIT_TRACE: /tmp/gittrace.log
GIT_TRACE_SETUP: /tmp/gittrace.log
run: |
set +e
: > /tmp/gittrace.log
echo "HOST initial: count=$(git rev-list --count HEAD 2>&1) shallow=$(test -f .git/shallow && echo YES || echo no)"
( task ci > /tmp/taskci.log 2>&1 ) & TASKCI=$!
CHANGED=0
for t in $(seq 1 120); do
cnt=$(git rev-list --count HEAD 2>/dev/null)
if [ -f .git/shallow ] || { [ -n "$cnt" ] && [ "$cnt" != "644" ]; }; then
echo ">>> HOST .git CHANGED at t=$t ($((t*2))s) : count=$cnt shallow=$(test -f .git/shallow && echo YES||echo no)"
echo "=== git-trace: fetch/clone/depth/shallow + setup cwd/git_dir ==="
grep -inE "fetch|clone|--depth|shallow|setup: git_dir|setup: cwd|setup: worktree" /tmp/gittrace.log | tail -50
echo "=== task ci tail (what ran) ==="; sed -E 's/\x1b\[[0-9;]*m//g' /tmp/taskci.log | tail -30
CHANGED=1; break
fi
sleep 2
done
[ "$CHANGED" = 0 ] && echo ">>> HOST never changed"
echo "=== FULL git-trace (depth/shallow/fetch only) ==="; grep -inE "--depth|shallow|fetch .*file|clone" /tmp/gittrace.log | head -30
kill $TASKCI 2>/dev/null
exit 1
- name: Write manifest
run: |
task manifest
- name: Publish images
if: |
github.event_name == 'workflow_dispatch' ||
github.event.pull_request.head.repo.full_name == github.repository
env:
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
run: |
task publish
- name: Attach manifest to workflow run
uses: actions/upload-artifact@v7
with:
name: manifest.yaml
path: ./manifest.yaml