Skip to content

Commit

Permalink
fix(ci): compile firmware-action in examples
Browse files Browse the repository at this point in the history
- we had some breaking changes in firmware-action since last release
- example tests need to know if to download firmware-action executable
  from release, or if to compile on the fly
- problem is that the example CI checks for changes of current HEAD vs
  MAIN, not vs latest release
- this patch should fix this behavior

Signed-off-by: AtomicFS <[email protected]>
  • Loading branch information
AtomicFS committed Nov 14, 2024
1 parent 032f607 commit 9fc0df0
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions .github/workflows/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,35 @@ jobs:
permissions:
pull-requests: read
outputs:
action: ${{ steps.filter.outputs.action }}
compile: ${{ steps.compile.outputs.compile }}
if: ${{ needs.skip-check.outputs.changes == 'true' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dorny/paths-filter@v3
- name: Get latest release
id: semver
uses: ietf-tools/semver-action@v1
with:
token: ${{ github.token }}
branch: ${{ github.ref }}
- name: Filter
uses: dorny/paths-filter@v3
id: filter
with:
filters: |
action:
- 'action/**'
- name: Compile
id: compile
# Require compilation if changes in action code or if breaking changes since last release
run: |
if [ "${{ steps.semver.outputs.bump }}" == "major" ] || [ "${{ 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
Expand Down Expand Up @@ -139,7 +155,7 @@ jobs:
config: 'tests/example_config__coreboot.json'
target: 'coreboot-example'
recursive: 'false'
compile: ${{ needs.changes.outputs.action }}
compile: ${{ needs.changes.outputs.compile }}
env:
COREBOOT_VERSION: ${{ matrix.coreboot-version }}

Expand Down Expand Up @@ -212,7 +228,7 @@ jobs:
config: 'tests/example_config__linux.json'
target: 'linux-example'
recursive: 'false'
compile: ${{ needs.changes.outputs.action }}
compile: ${{ needs.changes.outputs.compile }}
env:
LINUX_VERSION: ${{ matrix.linux-version }}
SYSTEM_ARCH: ${{ matrix.arch }}
Expand Down Expand Up @@ -293,7 +309,7 @@ jobs:
config: 'tests/example_config__edk2.json'
target: 'edk2-example'
recursive: 'false'
compile: ${{ needs.changes.outputs.action }}
compile: ${{ needs.changes.outputs.compile }}
env:
EDK2_VERSION: ${{ matrix.edk2-version }}
GCC_TOOLCHAIN_VERSION: ${{ steps.gcc_toolchain.outputs.gcc_toolchain_version }}
Expand Down Expand Up @@ -354,7 +370,7 @@ jobs:
config: 'tests/example_config__firmware_stitching.json'
target: 'stitching-example'
recursive: 'false'
compile: ${{ needs.changes.outputs.action }}
compile: ${{ needs.changes.outputs.compile }}
env:
COREBOOT_VERSION: ${{ matrix.coreboot-version }}

Expand Down Expand Up @@ -414,7 +430,7 @@ jobs:
config: 'tests/example_config__uroot.json'
target: 'u-root-example'
recursive: 'false'
compile: ${{ needs.changes.outputs.action }}
compile: ${{ needs.changes.outputs.compile }}
env:
UROOT_VERSION: ${{ matrix.uroot-version }}

Expand Down Expand Up @@ -478,6 +494,6 @@ jobs:
config: 'tests/example_config.json'
target: 'u-root-example'
recursive: 'false'
compile: ${{ needs.changes.outputs.action }}
compile: ${{ needs.changes.outputs.compile }}
env:
UROOT_VERSION: ${{ matrix.uroot-version }}

0 comments on commit 9fc0df0

Please sign in to comment.