Skip to content

ci: filter artifacts a bit #360

ci: filter artifacts a bit

ci: filter artifacts a bit #360

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches:
- '*-bpi'
- '*-ci'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
UBOOT_BRANCH: ${{ github.head_ref || github.ref_name }}
ATF_BRANCH: mtk-atf-2026
strategy:
fail-fast: false
matrix:
include:
- board: bpi-r2
boots: "sdmmc"
atf: false
ram8g: false
- board: bpi-r64
boots: "sdmmc emmc"
atf: true
ram8g: false
- board: bpi-r2pro
boots: "sdmmc"
atf: false
ram8g: false
- board: bpi-r3
boots: "sdmmc emmc spi-nand spi-nor"
atf: true
ram8g: false
- board: bpi-r3mini
boots: "emmc spi-nand"
atf: true
ram8g: false
- board: bpi-r4
boots: "sdmmc emmc spi-nand"
atf: true
ram8g: true
- board: bpi-r4lite
boots: "sdmmc emmc spi-nand"
atf: true
ram8g: false
- board: bpi-r4pro
boots: "sdmmc emmc spi-nand"
atf: true
ram8g: true
steps:
- uses: actions/checkout@v4
- name: Setup env
run: |
echo "DT=$(date +'%Y-%m-%d_%H%M')" >> $GITHUB_ENV
echo "UBOOTVER=$(make ubootversion)" >> $GITHUB_ENV
echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Print env
run: |
echo $BRANCH $UBOOTVER $DT
# ccache restore
- name: Restore ccache
uses: actions/cache@v4
with:
path: .cache/ccache
key: ccache-${{ matrix.board }}-${{ github.ref_name }}
restore-keys: |
ccache-${{ matrix.board }}-
ccache-
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install -y \
ccache libssl-dev u-boot-tools \
gcc-arm-linux-gnueabihf \
gcc-aarch64-linux-gnu \
make python3-pyelftools
- name: Fetch mtk-atf branch
if: matrix.atf == true
run: |
git fetch origin $ATF_BRANCH --depth=1
- name: Build
run: |
set -e
for boot in ${{ matrix.boots }}; do
echo "===================================="
echo "Building ${{ matrix.board }} for $boot"
echo "===================================="
git checkout $UBOOT_BRANCH
echo -e "board=${{ matrix.board }}\ndevice=$boot" > build.conf
bash build.sh importconfig
bash build.sh build
bash build.sh rename
# ATF builds (optional)
if [ "${{ matrix.atf }}" = "true" ]; then
git checkout build.conf
echo "---- ATF build for $boot ----"
git checkout $ATF_BRANCH
echo -e "board=${{ matrix.board }}\ndevice=$boot" > build.conf
# normal ATF build
bash build.sh build
bash build.sh rename
if [[ "$boot" == *"mmc"* ]]; then
bash build.sh createimg non-interactive
fi
if [ "${{ matrix.ram8g }}" == "true" ]; then
echo "extraflags=DDR4_4BG_MODE=1" >> build.conf
bash build.sh build
bash build.sh rename
fi
# optional: special NAND/UBI case
if [[ "$boot" == *"nand"* ]]; then
echo "extraflags=UBI=1" >> build.conf
bash build.sh build
bash build.sh rename
if [ "${{ matrix.ram8g }}" == "true" ]; then
echo "extraflags=UBI=1 DDR4_4BG_MODE=1" >> build.conf
bash build.sh build
bash build.sh rename
fi
fi
rm -f build.conf
else
bash build.sh createimg non-interactive
git checkout build.conf
fi
done
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: uboot-${{ matrix.board }}
path: |
${{ matrix.board }}*_fip.bin
u-boot-${{ matrix.board }}_*.bin
${{ matrix.board }}*_bl2.img
${{ matrix.board }}_*.img.gz