name: Coreboot
on:
push:
branches:
- main
pull_request:
branches:
- main
# When a PR is updated, cancel the jobs from the previous version. Merges
# do not define head_ref, so use run_id to never cancel those jobs.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
# .github/do-coreboot --buildtype release
# is the largest cache, 429.5M (September 2023).
DOCKERFILE: picolibc/.github/Dockerfile-coreboot
IMAGE_FILE: dockerimg-coreboot.tar.zst
IMAGE: picolibc
PACKAGES_FILE: picolibc/.github/coreboot-packages.txt
EXTRA_FILE: picolibc/.github/coreboot-files.txt
jobs:
cache-maker:
runs-on: ubuntu-latest
steps:
- name: Clone picolibc
uses: actions/checkout@v6
with:
path: picolibc
- name: Cache the Docker Image
id: cache
uses: actions/cache@v5
with:
path: ${{ env.IMAGE_FILE }}
key: ${{ env.IMAGE_FILE }}-${{ hashFiles( env.DOCKERFILE, env.PACKAGES_FILE, env.EXTRA_FILE ) }}
lookup-only: true
- name: Set up Docker Buildx
if: steps.cache.outputs.cache-hit != 'true'
uses: docker/setup-buildx-action@v3
- name: Build picolibc container
if: steps.cache.outputs.cache-hit != 'true'
uses: docker/build-push-action@v6
with:
platforms: linux/amd64
file: .github/Dockerfile-coreboot
tags: ${{ env.IMAGE }}:latest
outputs: type=docker,force-compression=true,compression=zstd,compression-level=22,dest=${{ env.IMAGE_FILE }}