plugin-barman-cloud/.github/workflows/ci.yml
Marco Nenciarini a968c3e85b
ci: debug commitlint merge-base in CI container
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
2026-06-05 18:21:02 +02:00

86 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: DEBUG commitlint git state
continue-on-error: true
run: |
echo "===== HOST ====="
git rev-parse origin/main HEAD || true
printf 'host merge-base: '; git merge-base origin/main HEAD || echo 'HOST: NONE'
echo "host rev-list count HEAD: $(git rev-list --count HEAD 2>&1)"
echo "host git config (fetch/commitgraph):"; git config --get-regexp 'fetch|commitgraph|commitGraph' || true
echo "host .git/objects/info:"; ls -la .git/objects/info/ 2>&1 || true
echo "host fsck:"; git fsck --connectivity-only 2>&1 | head -8 || true
echo "===== CONTAINER (dagger --source .) ====="
GITHUB_REF= dagger core container from --address=alpine/git \
with-mounted-directory --path=/src --source=. \
with-workdir --path=/src \
with-exec --use-entrypoint=false --args=sh,-c,'echo om=$(git rev-parse origin/main 2>&1); echo hd=$(git rev-parse HEAD 2>&1); printf mb= ; git merge-base origin/main HEAD 2>&1 || echo NONE; echo nlog:; git log --oneline -3 origin/main 2>&1; echo hlog:; git log --oneline -3 HEAD 2>&1; echo fsck:; git fsck --connectivity-only 2>&1 | head -8; echo cginfo:; ls -la .git/objects/info/ 2>&1; echo packedrefs:; head -30 .git/packed-refs 2>&1' \
stdout || true
- name: Run CI task
run: |
task ci
- 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