Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add build workflow for GitHub Actions. #20

Draft
wants to merge 9 commits into
base: icedream-experiments
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# This is a basic workflow to help you get started with Actions

name: Build

# Controls when the workflow will run
on:
push:
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: [ self-hosted, ubuntu ]

strategy:
matrix:
model:
- JC11

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Install dependencies
run: |
sudo apt-get update
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y \
bc \
binfmt-support \
build-essential \
cpio \
e2tools \
file \
git \
p7zip-full \
qemu-user-static \
rsync \
u-boot-tools \
unzip \
wget \
xz-utils
- name: Set up caching for buildroot downloads
uses: actions/cache@v1
with:
path: ~/buildroot-dl
key: buildroot-dl
- name: Set up ccache
uses: hendrikmuhs/[email protected]
with:
key: ${{ matrix.model }}
- name: Set up environment for buildroot
run: |
export BR2_CCACHE=y
export BR2_DL_DIR="$HOME/buildroot-dl"
- name: Set up Git for patching
run: |
git config --global user.name "Buildroot"
git config --global user.email "[email protected]"
- uses: actions/checkout@v3
- name: Run dist script
run: ./dist.sh
- name: Upload image as artifact
uses: actions/upload-artifact@v3
with:
retention_days: 3
name: firmware-image
path: '*.dtb'
- name: Upload updater tool as artifact
uses: actions/upload-artifact@v3
with:
retention_days: 3
name: firmware-updater-win
path: '*.exe'
4 changes: 4 additions & 0 deletions clone-buildroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

. ./functions.sh

if ! command -v 7z >/dev/null; then
log_fatal "You need 7-zip installed (7z command seems to be missing)."
fi

trap 'rm -f usr/lib/os-release; rmdir usr/lib usr || true' EXIT
7z x -o. "$unpacked_img_dir"/rootfs.img usr/lib/os-release

Expand Down
4 changes: 4 additions & 0 deletions compile-buildroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ if [ -n "${BR2_JLEVEL:-}" ]; then
make_flags+=(BR2_JLEVEL="${BR2_JLEVEL}")
fi

if [ -n "${BR2_CCACHE:-}" ]; then
make_flags+=(BR2_CCACHE="${BR2_CCACHE}")
fi

if [ -n "${BR2_CCACHE_DIR:-}" ]; then
make_flags+=(BR2_CCACHE_DIR="${BR2_CCACHE_DIR}")
fi
Expand Down