feat(docker): make containers multi-arch #885
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# Test built docker images by building simple projects inside them | |
name: dagger | |
on: | |
pull_request: | |
paths: | |
- '.dagger-ci' | |
- '.github/workflows/docker-build-and-test.yml' | |
- 'docker/**' | |
- 'tests/**' | |
push: | |
branches: ['main'] | |
paths: | |
- '.dagger-ci' | |
- '.github/workflows/docker-build-and-test.yml' | |
- 'docker/**' | |
- 'tests/**' | |
release: | |
schedule: | |
# Sunday midnight | |
- cron: '0 0 * * 0' | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
build: | |
name: build_test_publish | |
runs-on: ubuntu-latest | |
timeout-minutes: 240 | |
strategy: | |
matrix: | |
dockerfile: | |
[ | |
'coreboot_4.19', | |
'coreboot_4.20.1', | |
'coreboot_4.21', | |
'coreboot_4.22.01', | |
'coreboot_24.02', | |
'coreboot_24.02.01', | |
'coreboot_24.05', | |
'edk2-stable202008', | |
'edk2-stable202105', | |
'edk2-stable202111', | |
'edk2-stable202205', | |
'edk2-stable202208', | |
'edk2-stable202211', | |
'edk2-stable202408', | |
'linux_6.1.45', | |
'linux_6.1.111', | |
'linux_6.6.52', | |
'linux_6.9.9', | |
'linux_6.11', | |
'udk2017', | |
'uroot_0.14.0' | |
] | |
steps: | |
# We have to use my own fork of actions/delete-package-versions at the moment | |
# to have access to 'dry-run' and 'ignore-versions-include-tags' features | |
# We can switch to upstream whe following PRs get merged: | |
# - [dry-run](https://github.com/actions/delete-package-versions/pull/119/commits) | |
# - [tags](https://github.com/actions/delete-package-versions/pull/104 | |
- name: Delete old packages | |
uses: AtomicFS/delete-package-versions@main | |
continue-on-error: | |
true | |
# we have continue-on-error because when I make a fork of this repo to debug something, | |
# the Docker containers would not build because this step fails to fetch existing containers | |
# (in fresh fork there are none) | |
with: | |
package-name: firmware-action/${{ matrix.dockerfile }} | |
package-type: container | |
min-versions-to-keep: 5 | |
ignore-versions: | |
'^(main|latest|v(\d+\.?)+)$' | |
# ignore: | |
# - main | |
# - latest | |
# - vX | |
# - vX.X | |
# - vX.X.X | |
dry-run: false | |
ignore-versions-include-tags: true | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup docker-compose | |
uses: KengoTODA/actions-setup-docker-compose@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Validate compose file | |
run: docker-compose -f docker/compose.yaml config | |
- name: Install python dependencies | |
run: pip install -r ./.dagger-ci/daggerci/requirements.txt | |
- name: Run dagger pipeline | |
# If building coreboot use 120 minutes timeout, otherwise 15 minutes | |
timeout-minutes: ${{ startsWith(matrix.dockerfile, 'coreboot_') && 240 || 30 }} | |
run: | | |
if [[ "${GITHUB_EVENT_NAME}" == 'release' ]] || [[ "${GITHUB_REF}" == *'main' ]] || [[ "${GITHUB_REF_TYPE}" == 'tag' ]]; then | |
echo "Enable publishing" | |
python .dagger-ci/daggerci/main.py -d ${{ matrix.dockerfile }} --publish | |
else | |
echo "Disable publishing" | |
python .dagger-ci/daggerci/main.py -d ${{ matrix.dockerfile }} | |
fi | |
shell: bash | |
env: | |
GITHUB_REGISTRY: ${{ env.REGISTRY }} | |
GITHUB_ACTOR: ${{ github.actor }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |