Skip to content

Feat/edk2 202408

Feat/edk2 202408 #834

---
# Test built docker images by building simple projects inside them
name: dagger
on:
pull_request:
paths:
- '.github/workflows/docker-build-and-test.yml'
- 'docker/**'
push:
branches: ['main']
paths:
- '.github/workflows/docker-build-and-test.yml'
- 'docker/**'
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
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.9.9',
'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.12'
- 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
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 }}