Build CI images in parallel (#7296)

* Factor out common setup steps

* Re-order

* Split independent builds into parallel jobs

* Cache jetson builds

* Use zstd compression

* Switch from gha cache to registry cache

A CI run (four images cached with mode-max) populates the cache with 295
cache entries totalling 23.44 GB. This exceeds gha's 10GB limit, causing
trashing. Try with a registry instead.

* Enable manual CI runs
This commit is contained in:
Andrew Reiter
2023-07-27 08:56:12 -04:00
committed by GitHub
parent 961ce03835
commit a96602f3f5
3 changed files with 125 additions and 70 deletions

39
.github/actions/setup/action.yml vendored Normal file
View File

@@ -0,0 +1,39 @@
name: 'Setup'
description: 'Set up QEMU and Buildx'
inputs:
GITHUB_TOKEN:
required: true
outputs:
image-name:
value: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ github.ref_name }}-${{ env.SHORT_SHA }}
cache-name:
value: ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:cache
runs:
using: "composite"
steps:
- name: Remove unnecessary files
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
shell: bash
- id: lowercaseRepo
uses: ASzc/change-string-case-action@v5
with:
string: ${{ github.repository }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the Container registry
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ inputs.GITHUB_TOKEN }}
- name: Create version file
run: make version
shell: bash
- name: Create short sha
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV
shell: bash