-
-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add build image function to GitHub Actions (#1008)
The 'Build Image' action was primarily written by Holger Friedrich and then edited for better functionality in the openHABian core repo. This also contains other changes to the CI setup, such as moving the ShellCheck checks out of Travis and instead enforcing them in GitHub Actions. Along with theses changes, some improvements to the build script and install output were also made. These changes to the build script include using cURL over wget for downloading needed files and also cloning the openHABian repo in the build process rather than the install process. This change was made because the repo must be present for offline install to work, and as such it makes sense to provide it with the image to reduce points of failure on install. Fixes #991 Co-authored-by: Holger Friedrich <[email protected]> Co-authored-by: Markus Storm <[email protected]> Signed-off-by: Ethan Dye <[email protected]>
- Loading branch information
1 parent
6b23e87
commit 6342c92
Showing
13 changed files
with
394 additions
and
232 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: Build Image | ||
|
||
# Trigger the workflow on push or pull request | ||
on: | ||
push: | ||
paths: | ||
- 'build.bash' | ||
- 'build-image/openhabian-installer.service' | ||
pull_request: | ||
paths: | ||
- 'build.bash' | ||
- 'build-image/openhabian-installer.service' | ||
workflow_dispatch: | ||
inputs: | ||
comments: | ||
description: 'Build comments' | ||
default: 'Build for testing purposes' | ||
|
||
jobs: | ||
build32: | ||
# Using latest Ubuntu (not the GitHub Actions default) to get latest tool versions in GitHub Actions environment | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
- name: Environment variables | ||
run: sudo -E bash -c set | ||
- name: Install required packages | ||
run: sudo apt-get install git curl unzip libarchive-zip-perl dos2unix xz-utils kpartx | ||
- name: getimagename | ||
id: getimagename | ||
run: | | ||
echo "::set-output name=image::$(basename "$(curl "https://downloads.raspberrypi.org/raspios_lite_armhf_latest" -s -L -I -o /dev/null -w '%{url_effective}')")" | ||
- name: Cache Raspberry Pi OS image | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.getimagename.outputs.image }} | ||
key: ${{ steps.getimagename.outputs.image }} | ||
- name: Run build.bash rpi | ||
run: | | ||
sudo -E ./ci-setup.bash github pi-raspios32 | ||
sudo -E ./build.bash rpi | ||
- name: getfilename | ||
id: getfilename | ||
run: echo "::set-output name=file::$(ls openhabian-*.img.xz)" | ||
- name: Archive | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ steps.getfilename.outputs.file }} | ||
path: ${{ steps.getfilename.outputs.file }} | ||
build64experimental: | ||
# Using latest Ubuntu (not the GitHub Actions default) to get latest tool versions in GitHub Actions environment | ||
runs-on: ubuntu-20.04 | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
- name: Environment variables | ||
run: sudo -E bash -c set | ||
- name: Install required packages | ||
run: sudo apt-get install git curl unzip libarchive-zip-perl dos2unix xz-utils kpartx | ||
- name: getimagename | ||
id: getimagename | ||
run: | | ||
echo "::set-output name=image::$(basename "$(curl "https://downloads.raspberrypi.org/raspios_arm64_latest" -s -L -I -o /dev/null -w '%{url_effective}')")" | ||
- name: Cache Raspberry Pi OS image | ||
uses: actions/cache@v2 | ||
with: | ||
path: ${{ steps.getimagename.outputs.image }} | ||
key: ${{ steps.getimagename.outputs.image }} | ||
- name: Run build.bash rpi64 | ||
run: | | ||
sudo -E ./ci-setup.bash github pi-raspios64beta | ||
sudo -E ./build.bash rpi64 | ||
- name: getfilename | ||
id: getfilename | ||
run: echo "::set-output name=file::$(ls openhabian-*.img.xz)" | ||
- name: Archive | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: ${{ steps.getfilename.outputs.file }} | ||
path: ${{ steps.getfilename.outputs.file }} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM balenalib/intel-nuc-ubuntu:focal-build | ||
FROM balenalib/amd64-ubuntu:focal-build | ||
|
||
|
||
ENV container docker | ||
|
Oops, something went wrong.