test: add missing coreboot configs for tests #3502
Workflow file for this run
This file contains hidden or 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
--- | |
# Example of using firmware-action | |
name: example | |
on: | |
pull_request: | |
pull_request_review: | |
types: ['submitted'] | |
merge_group: | |
push: | |
branches: ['main'] | |
tags: ['v*'] | |
env: | |
APPLY_FIXES: none | |
APPLY_FIXES_EVENT: pull_request | |
APPLY_FIXES_MODE: commit | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }} | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
jobs: | |
# Status check for all jobs below | |
# This is to allow SKIPPED be considered as SUCCESS | |
status-check-example: | |
runs-on: ubuntu-latest | |
if: always() | |
needs: | |
- build-coreboot | |
- build-linux | |
- build-edk2 | |
- build-stitching | |
- build-uboot | |
- build-uroot | |
- test-operating-systems | |
steps: | |
- name: Check status | |
uses: re-actors/alls-green@release/v1 | |
with: | |
allowed-skips: ${{ toJSON(needs) }} | |
jobs: ${{ toJSON(needs) }} | |
# Check we jobs should be ran or skipped | |
skip-check: | |
runs-on: ubuntu-latest | |
# Required permissions | |
permissions: | |
pull-requests: read | |
outputs: | |
changes: ${{ steps.filter.outputs.changes }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v5 | |
with: | |
fetch-depth: 0 | |
- uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
filters: | | |
changes: | |
- '.github/workflows/example.yml' | |
- 'docker/**' | |
- 'tests/**' | |
- 'action.yml' | |
- 'cmd/firmware-action/**' | |
# Change detection in action golang code | |
changes: | |
runs-on: ubuntu-latest | |
needs: skip-check | |
# Required permissions | |
permissions: | |
pull-requests: read | |
outputs: | |
compile: ${{ steps.compile.outputs.compile }} | |
if: ${{ needs.skip-check.outputs.changes == 'true' }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v5 | |
with: | |
fetch-depth: 0 | |
- name: Get latest release | |
id: semver | |
uses: ietf-tools/semver-action@v1 | |
with: | |
token: ${{ github.token }} | |
branch: ${{ github.ref }} | |
noVersionBumpBehavior: patch | |
noNewCommitBehavior: warn | |
- name: Filter | |
uses: dorny/paths-filter@v3 | |
id: filter | |
with: | |
filters: | | |
action: | |
- 'cmd/firmware-action/**' | |
- 'action.yml' | |
- name: Compile | |
id: compile | |
# Require compilation if: | |
# - any changes in action golang code | |
# - any breaking changes since last release | |
# - any new features since last release | |
run: | | |
if [ "${{ steps.semver.outputs.bump }}" == "major" ] || [ "${{ steps.semver.outputs.bump }}" == "minor" ] || [ "${{ steps.filter.outputs.action }}" == "true" ]; then | |
echo "compile=true" >> "${GITHUB_OUTPUT}" | |
else | |
echo "compile=false" >> "${GITHUB_OUTPUT}" | |
fi | |
# Example of building coreboot | |
# ANCHOR: example_build_coreboot | |
build-coreboot: | |
needs: | |
- changes | |
- skip-check | |
strategy: | |
fail-fast: false | |
matrix: | |
coreboot-version: ['24.02.01'] | |
arch: ['amd64', 'arm64'] | |
runs-on: ${{ matrix.arch == 'arm64' && 'ARM64' || 'ubuntu-latest' }} | |
if: ${{ ! (github.event_name == 'pull_request_review' && github.actor != 'github-actions[bot]') && needs.skip-check.outputs.changes == 'true' }} | |
# Skip if pull_request_review on PR not made by a bot | |
steps: | |
- name: Cleanup | |
run: | | |
rm -rf ./* || true | |
rm -rf ./.??* || true | |
- name: Checkout | |
uses: actions/checkout@v5 | |
- name: Restore cached coreboot repo | |
uses: actions/cache/restore@v4 | |
id: cache-repo | |
with: | |
path: ./my_super_dooper_awesome_coreboot | |
key: coreboot-${{ matrix.coreboot-version }}-example | |
- name: Clone coreboot repo | |
if: steps.cache-repo.outputs.cache-hit != 'true' | |
run: | | |
git clone --branch "${{ matrix.coreboot-version }}" --depth 1 https://review.coreboot.org/coreboot my_super_dooper_awesome_coreboot | |
- name: Store coreboot repo in cache | |
uses: actions/cache/save@v4 | |
if: steps.cache-repo.outputs.cache-hit != 'true' | |
with: | |
path: ./my_super_dooper_awesome_coreboot | |
key: coreboot-${{ matrix.coreboot-version }}-example | |
- name: Move my defconfig into place (filename must not contain '.defconfig') | |
run: | | |
mv "tests/coreboot_${{ matrix.coreboot-version }}/seabios.defconfig" "seabios_defconfig" | |
- name: firmware-action | |
uses: ./ | |
# uses: 9elements/firmware-action | |
with: | |
config: |- | |
tests/example_config__coreboot.json | |
tests/example_config__uroot.json | |
target: 'coreboot-example' | |
recursive: 'false' | |
compile: ${{ needs.changes.outputs.compile }} | |
debug: 'true' | |
enable-cache: 'true' | |
auto-download-artifacts: 'true' | |
auto-upload-artifacts: 'true' | |
env: | |
COREBOOT_VERSION: ${{ matrix.coreboot-version }} | |
UROOT_VERSION: 'dummy' | |
# ANCHOR_END: example_build_coreboot | |
# Example of building Linux kernel | |
# ANCHOR: example_build_linux_kernel | |
build-linux: | |
needs: | |
- changes | |
- skip-check | |
strategy: | |
fail-fast: false | |
matrix: | |
linux-version: ['6.12'] | |
arch: ['amd64', 'arm64'] | |
runs-on: ${{ matrix.arch == 'arm64' && 'ARM64' || 'ubuntu-latest' }} | |
if: ${{ ! (github.event_name == 'pull_request_review' && github.actor != 'github-actions[bot]') && needs.skip-check.outputs.changes == 'true' }} | |
# Skip if pull_request_review on PR not made by a bot | |
steps: | |
- name: Cleanup | |
run: | | |
rm -rf ./* || true | |
rm -rf ./.??* || true | |
- name: Checkout | |
uses: actions/checkout@v5 | |
- name: Restore cached linux source | |
id: cache-repo | |
uses: actions/cache/restore@v4 | |
with: | |
path: ./linux-${{ matrix.linux-version }}.tar.xz | |
key: linux-${{ matrix.linux-version }}-example | |
- name: Prepare linux kernel | |
run: | | |
# Download source files | |
wget --quiet --continue "https://cdn.kernel.org/pub/linux/kernel/v${LINUX_MAJOR_VERSION}.x/linux-${{ matrix.linux-version }}.tar.xz" | |
wget --quiet "https://cdn.kernel.org/pub/linux/kernel/v${LINUX_MAJOR_VERSION}.x/linux-${{ matrix.linux-version }}.tar.sign" | |
unxz --keep "linux-${{ matrix.linux-version }}.tar.xz" >/dev/null | |
# Verify GPG signature | |
gpg2 --locate-keys torvalds@kernel.org gregkh@kernel.org | |
gpg2 --verify "linux-${{ matrix.linux-version }}.tar.sign" | |
# Extract | |
tar -xvf "linux-${{ matrix.linux-version }}.tar" | |
env: | |
LINUX_MAJOR_VERSION: 6 | |
- name: Store linux source in cache | |
uses: actions/cache/save@v4 | |
if: steps.cache-repo.outputs.cache-hit != 'true' | |
with: | |
path: ./linux-${{ matrix.linux-version }}.tar.xz | |
key: linux-${{ matrix.linux-version }}-example | |
- name: Move my defconfig into place (filename must not contain '.defconfig') | |
run: | | |
mv "tests/linux_${{ matrix.linux-version }}/linux.defconfig" "ci_defconfig" | |
- name: firmware-action | |
uses: ./ | |
# uses: 9elements/firmware-action | |
with: | |
config: |- | |
tests/example_config__uroot.json | |
tests/example_config__linux.json | |
target: 'linux-example' | |
recursive: 'false' | |
compile: ${{ needs.changes.outputs.compile }} | |
debug: 'true' | |
enable-cache: 'true' | |
auto-download-artifacts: 'true' | |
auto-upload-artifacts: 'true' | |
env: | |
LINUX_VERSION: ${{ matrix.linux-version }} | |
SYSTEM_ARCH: ${{ matrix.arch }} | |
UROOT_VERSION: 'dummy' | |
# ANCHOR_END: example_build_linux_kernel | |
# Example of building EDK2 | |
# ANCHOR: example_build_edk2 | |
build-edk2: | |
runs-on: ubuntu-latest | |
needs: | |
- changes | |
- skip-check | |
strategy: | |
fail-fast: false | |
matrix: | |
edk2-version: ['edk2-stable202211'] | |
# TODO | |
if: ${{ ! (github.event_name == 'pull_request_review' && github.actor != 'github-actions[bot]') && needs.skip-check.outputs.changes == 'true' }} | |
# Skip if pull_request_review on PR not made by a bot | |
steps: | |
- name: Cleanup | |
run: | | |
rm -rf ./* || true | |
rm -rf ./.??* || true | |
- name: Checkout | |
uses: actions/checkout@v5 | |
- name: Restore cached edk2 repo | |
uses: actions/cache/restore@v4 | |
id: cache-repo | |
with: | |
path: ./Edk2 | |
key: edk2-${{ matrix.edk2-version }}-example | |
- name: Clone edk2 repo | |
if: steps.cache-repo.outputs.cache-hit != 'true' | |
run: | | |
git clone --recurse-submodules --branch "${{ matrix.edk2-version }}" --depth 1 https://github.com/tianocore/edk2.git Edk2 | |
- name: Prepare file with build arguments | |
run: | | |
echo "-D BOOTLOADER=COREBOOT -D TPM_ENABLE=TRUE -D NETWORK_IPXE=TRUE" > "edk2_config.cfg" | |
- name: Store edk2 repo in cache | |
uses: actions/cache/save@v4 | |
if: steps.cache-repo.outputs.cache-hit != 'true' | |
with: | |
path: ./Edk2 | |
key: edk2-${{ matrix.edk2-version }}-example | |
- name: Get versions of edk2 | |
id: edk2_versions | |
run: | | |
echo "ver_current=$( echo ${{ matrix.edk2-version }} | tr -cd '0-9' )" >> "${GITHUB_OUTPUT}" | |
echo "ver_breaking=$( echo 'edk2-stable202305' | tr -cd '0-9' )" >> "${GITHUB_OUTPUT}" | |
- name: Use GCC5 for old edk2 | |
id: gcc_toolchain | |
# GCC5 is deprecated since edk2-stable202305 | |
# For more information see https://github.com/9elements/firmware-action/issues/340 | |
run: | | |
if [[ ! ${{ steps.edk2_versions.outputs.ver_current }} < ${{ steps.edk2_versions.outputs.ver_breaking }} ]]; then | |
echo "gcc_toolchain_version=GCC" >> "${GITHUB_OUTPUT}" | |
else | |
echo "gcc_toolchain_version=GCC5" >> "${GITHUB_OUTPUT}" | |
fi | |
- name: firmware-action | |
uses: ./ | |
# uses: 9elements/firmware-action | |
with: | |
config: 'tests/example_config__edk2.json' | |
target: 'edk2-example' | |
recursive: 'false' | |
compile: ${{ needs.changes.outputs.compile }} | |
debug: 'true' | |
enable-cache: 'true' | |
auto-download-artifacts: 'true' | |
auto-upload-artifacts: 'true' | |
env: | |
EDK2_VERSION: ${{ matrix.edk2-version }} | |
GCC_TOOLCHAIN_VERSION: ${{ steps.gcc_toolchain.outputs.gcc_toolchain_version }} | |
# ANCHOR_END: example_build_edk2 | |
# Example of building Firmware Stitching | |
# ANCHOR: example_build_stitch | |
build-stitching: | |
needs: | |
- changes | |
- skip-check | |
strategy: | |
fail-fast: false | |
matrix: | |
coreboot-version: ['4.19'] | |
arch: ['amd64', 'arm64'] | |
runs-on: ${{ matrix.arch == 'arm64' && 'ARM64' || 'ubuntu-latest' }} | |
if: ${{ ! (github.event_name == 'pull_request_review' && github.actor != 'github-actions[bot]') && needs.skip-check.outputs.changes == 'true' }} | |
# Skip if pull_request_review on PR not made by a bot | |
steps: | |
- name: Cleanup | |
run: | | |
rm -rf ./* || true | |
rm -rf ./.??* || true | |
- name: Checkout | |
uses: actions/checkout@v5 | |
- name: Restore cached coreboot-blobs repo | |
uses: actions/cache/restore@v4 | |
id: cache-repo | |
with: | |
path: ./stitch | |
key: coreboot-blobs-${{ matrix.coreboot-version }}-example | |
- name: Clone blobs repo | |
if: steps.cache-repo.outputs.cache-hit != 'true' | |
run: | | |
git clone --depth 1 https://review.coreboot.org/blobs stitch | |
- name: Store coreboot-blobs repo in cache | |
uses: actions/cache/save@v4 | |
if: steps.cache-repo.outputs.cache-hit != 'true' | |
with: | |
path: ./stitch | |
key: coreboot-blobs-${{ matrix.coreboot-version }}-example | |
- name: firmware-action | |
uses: ./ | |
# uses: 9elements/firmware-action | |
with: | |
config: 'tests/example_config__firmware_stitching.json' | |
target: 'stitching-example' | |
recursive: 'false' | |
compile: ${{ needs.changes.outputs.compile }} | |
debug: 'true' | |
enable-cache: 'true' | |
auto-download-artifacts: 'true' | |
auto-upload-artifacts: 'true' | |
env: | |
COREBOOT_VERSION: ${{ matrix.coreboot-version }} | |
# ANCHOR_END: example_build_stitch | |
# Example of building u-root | |
# ANCHOR: example_build_uroot | |
build-uroot: | |
needs: | |
- changes | |
- skip-check | |
strategy: | |
fail-fast: false | |
matrix: | |
uroot-version: ['0.15.0'] | |
arch: ['amd64', 'arm64'] | |
runs-on: ${{ matrix.arch == 'arm64' && 'ARM64' || 'ubuntu-latest' }} | |
if: ${{ ! (github.event_name == 'pull_request_review' && github.actor != 'github-actions[bot]') && needs.skip-check.outputs.changes == 'true' }} | |
# Skip if pull_request_review on PR not made by a bot | |
steps: | |
- name: Cleanup | |
run: | | |
rm -rf ./* || true | |
rm -rf ./.??* || true | |
- name: Checkout | |
uses: actions/checkout@v5 | |
- name: Restore cached u-root repo | |
uses: actions/cache/restore@v4 | |
id: cache-repo | |
with: | |
path: ./u-root | |
key: u-root-${{ matrix.uroot-version }}-example | |
- name: Clone u-root repo | |
if: steps.cache-repo.outputs.cache-hit != 'true' | |
run: | | |
git clone --depth 1 --branch v${{ matrix.uroot-version }} https://github.com/u-root/u-root.git || true | |
- name: Store u-root repo in cache | |
uses: actions/cache/save@v4 | |
if: steps.cache-repo.outputs.cache-hit != 'true' | |
with: | |
path: ./u-root | |
key: u-root-${{ matrix.uroot-version }}-example | |
- name: firmware-action | |
uses: ./ | |
# uses: 9elements/firmware-action | |
with: | |
config: 'tests/example_config__uroot.json' | |
target: 'u-root-example' | |
recursive: 'false' | |
compile: ${{ needs.changes.outputs.compile }} | |
debug: 'true' | |
enable-cache: 'true' | |
auto-download-artifacts: 'true' | |
auto-upload-artifacts: 'true' | |
env: | |
UROOT_VERSION: ${{ matrix.uroot-version }} | |
# ANCHOR_END: example_build_uroot | |
# Example of building u-boot | |
# ANCHOR: example_build_uboot | |
build-uboot: | |
needs: | |
- changes | |
- skip-check | |
strategy: | |
fail-fast: false | |
matrix: | |
uboot-version: ['2025.01'] | |
arch: ['amd64', 'arm64'] | |
runs-on: ${{ matrix.arch == 'arm64' && 'ARM64' || 'ubuntu-latest' }} | |
if: ${{ ! (github.event_name == 'pull_request_review' && github.actor != 'github-actions[bot]') && needs.skip-check.outputs.changes == 'true' }} | |
# Skip if pull_request_review on PR not made by a bot | |
steps: | |
- name: Cleanup | |
run: | | |
rm -rf ./* || true | |
rm -rf ./.??* || true | |
- name: Checkout | |
uses: actions/checkout@v5 | |
- name: Restore cached u-boot repo | |
uses: actions/cache/restore@v4 | |
id: cache-repo | |
with: | |
path: ./u-boot | |
key: u-boot-${{ matrix.uboot-version }}-example | |
- name: Clone u-boot repo | |
if: steps.cache-repo.outputs.cache-hit != 'true' | |
run: | | |
git clone https://source.denx.de/u-boot/u-boot.git | |
cd u-boot | |
git fetch -a | |
git checkout "v${{ matrix.uboot-version }}" | |
- name: Store u-boot repo in cache | |
uses: actions/cache/save@v4 | |
if: steps.cache-repo.outputs.cache-hit != 'true' | |
with: | |
path: ./u-boot | |
key: u-boot-${{ matrix.uboot-version }}-example | |
- name: Move my defconfig into place (filename must not contain '.defconfig') | |
run: | | |
mv "tests/uboot_${{ matrix.uboot-version }}/uboot.defconfig" "uboot_defconfig" | |
- name: firmware-action | |
uses: ./ | |
# uses: 9elements/firmware-action | |
with: | |
config: 'tests/example_config__uboot.json' | |
target: 'u-boot-example' | |
recursive: 'false' | |
compile: ${{ needs.changes.outputs.compile }} | |
debug: 'true' | |
enable-cache: 'true' | |
auto-download-artifacts: 'true' | |
auto-upload-artifacts: 'true' | |
env: | |
UBOOT_VERSION: ${{ matrix.uboot-version }} | |
# ANCHOR_END: example_build_uboot | |
# Example of using universal module | |
# ANCHOR: example_build_universal | |
build-universal: | |
needs: | |
- changes | |
- skip-check | |
runs-on: ubuntu-latest | |
if: ${{ ! (github.event_name == 'pull_request_review' && github.actor != 'github-actions[bot]') && needs.skip-check.outputs.changes == 'true' }} | |
# Skip if pull_request_review on PR not made by a bot | |
steps: | |
- name: Cleanup | |
run: | | |
rm -rf ./* || true | |
rm -rf ./.??* || true | |
- name: Checkout | |
uses: actions/checkout@v5 | |
- name: firmware-action | |
uses: ./ | |
# uses: 9elements/firmware-action | |
with: | |
config: 'tests/example_config__universal.json' | |
target: 'universal-example' | |
recursive: 'false' | |
compile: ${{ needs.changes.outputs.compile }} | |
- name: Get artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: universal | |
path: output-universal | |
retention-days: 14 | |
# ANCHOR_END: example_build_universal | |
# Example of building with pruning enabled | |
# ANCHOR: example_build_prune | |
build-with-pruning: | |
needs: | |
- changes | |
- skip-check | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
prune: ['true', 'false'] | |
if: ${{ ! (github.event_name == 'pull_request_review' && github.actor != 'github-actions[bot]') && needs.skip-check.outputs.changes == 'true' }} | |
# Skip if pull_request_review on PR not made by a bot | |
steps: | |
- name: Cleanup | |
run: | | |
rm -rf ./* || true | |
rm -rf ./.??* || true | |
- name: Checkout | |
uses: actions/checkout@v5 | |
- name: firmware-action | |
uses: ./ | |
# uses: 9elements/firmware-action | |
with: | |
config: 'tests/example_config__depends.json' | |
target: 'universal-example-B' | |
recursive: 'true' | |
prune: ${{ matrix.prune }} | |
compile: ${{ needs.changes.outputs.compile }} | |
- name: Get artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: prune | |
path: output-universal-example-B-${{ matrix.prune }} | |
retention-days: 14 | |
# ANCHOR_END: example_build_prune | |
build-universal-nested-output: | |
needs: | |
- changes | |
- skip-check | |
runs-on: ubuntu-latest | |
if: ${{ ! (github.event_name == 'pull_request_review' && github.actor != 'github-actions[bot]') && needs.skip-check.outputs.changes == 'true' }} | |
# Skip if pull_request_review on PR not made by a bot | |
steps: | |
- name: Cleanup | |
run: | | |
rm -rf ./* || true | |
rm -rf ./.??* || true | |
- name: Checkout | |
uses: actions/checkout@v5 | |
- name: firmware-action | |
uses: ./ | |
# uses: 9elements/firmware-action | |
with: | |
config: 'tests/example_config__universal__with_nested_output.json' | |
target: 'universal-example-nested-output' | |
recursive: 'false' | |
compile: ${{ needs.changes.outputs.compile }} | |
debug: 'true' | |
enable-cache: 'true' | |
auto-download-artifacts: 'true' | |
auto-upload-artifacts: 'true' | |
# Example of running on non-Linux systems | |
test-operating-systems: | |
strategy: | |
fail-fast: false | |
matrix: | |
#os: [ubuntu-latest, windows-latest, macos-latest] | |
os: [ubuntu-latest] | |
uroot-version: ['0.14.0'] | |
runs-on: ${{ matrix.os }} | |
needs: | |
- changes | |
- skip-check | |
if: ${{ ! (github.event_name == 'pull_request_review' && github.actor != 'github-actions[bot]') && needs.skip-check.outputs.changes == 'true' }} | |
# Skip if pull_request_review on PR not made by a bot | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v5 | |
- name: Restore cached u-root repo | |
uses: actions/cache/restore@v4 | |
id: cache-repo | |
with: | |
path: ./u-root | |
key: u-root-${{ matrix.uroot-version }}-example | |
- name: Clone u-root repo | |
if: steps.cache-repo.outputs.cache-hit != 'true' | |
run: | | |
git clone --depth 1 --branch v${{ matrix.uroot-version }} https://github.com/u-root/u-root.git | |
- name: Store u-root repo in cache | |
uses: actions/cache/save@v4 | |
if: steps.cache-repo.outputs.cache-hit != 'true' | |
with: | |
path: ./u-root | |
key: u-root-${{ matrix.uroot-version }}-example | |
- name: Install docker | |
if: ${{ runner.os == 'macOS' }} | |
run: | | |
brew install docker | |
brew install colima | |
brew services start colima | |
- name: firmware-action | |
continue-on-error: true | |
# This one fails on Windows and MacOS | |
# Since we do not have any real use-case right now, I will not fix it | |
uses: ./ | |
with: | |
config: 'tests/example_config.json' | |
target: 'u-root-example' | |
recursive: 'false' | |
compile: ${{ needs.changes.outputs.compile }} | |
debug: 'true' | |
enable-cache: 'true' | |
auto-download-artifacts: 'true' | |
auto-upload-artifacts: 'true' | |
env: | |
COREBOOT_VERSION: '4.19' | |
LINUX_VERSION: '6.9.9' | |
SYSTEM_ARCH: 'amd64' | |
EDK2_VERSION: 'edk2-stable202208' | |
GCC_TOOLCHAIN_VERSION: 'GCC' | |
UROOT_VERSION: ${{ matrix.uroot-version }} | |
UBOOT_VERSION: '2025.01' |