Skip to content

chore: bump the cargo-patch group with 4 updates #232

chore: bump the cargo-patch group with 4 updates

chore: bump the cargo-patch group with 4 updates #232

Workflow file for this run

name: Package
# On a packaging change in a PR, build both arches (no push) so breakage is caught before
# merge. Building and pushing the versioned image to GHCR happens in the Release workflow,
# so there is nothing to build on push to main here (main is protected, so the merged tree
# is the one already built on the PR).
on:
pull_request:
permissions:
contents: read
jobs:
changes:
name: Detect changes
runs-on: ubuntu-latest
outputs:
pkg: ${{ steps.filter.outputs.pkg }}
steps:
- uses: actions/checkout@v7
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
pkg:
- 'src/**'
- 'Cargo.toml'
- 'Cargo.lock'
- 'Dockerfile'
- '.dockerignore'
- '.github/workflows/package.yml'
validate:
name: Build image (${{ matrix.platform }})
needs: changes
if: needs.changes.outputs.pkg == 'true'
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- platform: linux/amd64
runner: ubuntu-latest
- platform: linux/arm64
runner: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v7
- uses: docker/setup-buildx-action@v4
# Build both arches (no push) so arm64 breakage surfaces on the PR, not at release.
- name: Build image (no push)
uses: docker/build-push-action@v7
with:
context: .
file: Dockerfile
platforms: ${{ matrix.platform }}
push: false
load: true
tags: git-cache-proxy:ci
cache-from: type=gha,scope=${{ matrix.platform }}
cache-to: type=gha,mode=max,scope=${{ matrix.platform }}
# /readyz probes the cache root for writes, so this fails if the non-root
# user cannot write the default cache directory.
- name: Check image runs as non-root with a writable cache
run: |
test "$(docker run --rm --entrypoint id git-cache-proxy:ci -u)" = 10001
docker run -d --name smoke -p 8080:8080 git-cache-proxy:ci --upstream https://example.invalid
for _ in $(seq 1 30); do
curl -fsS localhost:8080/readyz && exit 0
sleep 1
done
docker logs smoke
exit 1
# An orphan is reparented to the container's PID 1; without an init that
# reaps, it stays a zombie (git leaves such orphans after every fetch).
- name: Check orphaned processes are reaped
run: |
docker exec smoke sh -c 'sleep 1 & exit'
sleep 3
if docker exec smoke ps -o stat | grep -q '^Z'; then
docker exec smoke ps -o pid,ppid,stat,args
exit 1
fi