mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-29 20:23:01 +02:00
There are 2 main reasons for this:
1) It's almost impossible to write complex logical expressions in GH
workflows. I wanted to pass "" as flavor when not building _minimal.
So that the end target string would become TARGET + FLAVOR where
FLAVOR is empty, making it x86_64 for example.
As it turns out "" is false in GH workflow logical expressions, this
in conjunction with the limitations the interpreter has made it hard
to actually write sane expressions in the "with:" variables when
calling downstream jobs via workflow calls.
Here's an example of what I was trying to do and could not:
with:
flavor: ${{ (
github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'ci:main')
) && '' || '_minimal' }}
As '' is false, the first sets of expressions always evaluates to
false making the string "_minimal". I tried bracing this in various
ways and to use "null" or various JSON objects, all in vain.
2) It reduces complexity instead of adding additional.
Signed-off-by: Richard Alpe <richard@bit42.se>
74 lines
1.8 KiB
YAML
74 lines
1.8 KiB
YAML
name: Generic X86 GitHub Build
|
|
|
|
on:
|
|
push:
|
|
|
|
jobs:
|
|
build:
|
|
if: github.repository != 'kernelkit/infix'
|
|
name: Infix x86_64
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Install build dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
bc binutils build-essential bzip2 cpio \
|
|
diffutils file findutils git gzip \
|
|
libncurses-dev libssl-dev perl patch \
|
|
python3 rsync sed tar unzip wget \
|
|
autopoint bison flex autoconf automake \
|
|
mtools
|
|
|
|
- name: Checkout infix repo
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: ${{ github.repository }}
|
|
ref: ${{ github.ref }}
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
|
|
- name: Set Build Variables
|
|
id: vars
|
|
run: |
|
|
echo "INFIX_BUILD_ID=${{ github.run_id }}" >> $GITHUB_OUTPUT
|
|
echo "dir=Infix-x86_64" >> $GITHUB_OUTPUT
|
|
echo "tgz=Infix-x86_64.tar.gz" >> $GITHUB_OUTPUT
|
|
|
|
- name: Configure x86_64_minimal
|
|
run: |
|
|
make x86_64_minimal_defconfig
|
|
|
|
- name: Unit Test x86_64
|
|
run: |
|
|
make test-unit
|
|
|
|
- name: Build x86_64_minimal
|
|
run: |
|
|
make
|
|
|
|
- name: Check SBOM
|
|
run: |
|
|
make legal-info
|
|
|
|
- name: Report Build Size
|
|
run: |
|
|
du -sh .
|
|
du -sh output
|
|
du -sh dl || true
|
|
ls -l output/images/
|
|
|
|
- name: Prepare Artifact
|
|
run: |
|
|
cd output/
|
|
mv images Infix-x86_64
|
|
ln -s Infix-x86_64 images
|
|
tar cfz Infix-x86_64.tar.gz Infix-x86_64
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
path: output/Infix-x86_64.tar.gz
|
|
name: artifact-x86_64
|
|
|