-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI/CD basic implementation based on GitHub Actions (#167)
CI/CD basic implementation based on GitHub Actions
- Loading branch information
Showing
4 changed files
with
101 additions
and
2 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,54 @@ | ||
name: CI | ||
|
||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
model: [ "hydrafw" ] | ||
fail-fast: true | ||
|
||
steps: | ||
- name: Update package cache | ||
run: sudo apt update -y | ||
|
||
- name: Install packages | ||
run: sudo apt install -y --no-install-recommends --no-install-suggests bash coreutils tar bzip2 git make python3 python3-pip | ||
|
||
- name: Install python modules | ||
run: python3 -m pip install GitPython intelhex --upgrade | ||
|
||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
fetch-tags: true | ||
fetch-depth: 0 | ||
|
||
- name: Set git meta info | ||
run: echo "GITHUB_CI_PR_SHA=${{github.event.pull_request.head.sha}}" >> "${GITHUB_ENV}" | ||
|
||
- name: Install standalone reference GCC toolchain | ||
run: bash scripts/env.sh | ||
|
||
- name: Build ${{ matrix.model }} | ||
run: source build.env && arm-none-eabi-gcc --version && arm-none-eabi-gcc -print-search-dirs && make V=1 -j$(nproc) -C src/ | ||
|
||
- name: Archive ${{ matrix.model }} artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.model }} | ||
path: | | ||
src/build/${{ matrix.model }}.dfu | ||
if-no-files-found: error | ||
|
||
|
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,33 @@ | ||
#!/usr/bin/env bash | ||
#set -x | ||
set -e | ||
|
||
# This script is used to enroll toolchain with GitHub Actions for CI/CD purposes | ||
# But this script can be used as reference to install recommended toolchain for building hydrafw.dfu locally as well | ||
|
||
MD5SUM=8a4a74872830f80c788c944877d3ad8c | ||
TARBALL=gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.bz2 | ||
TARDIR=gcc-arm-none-eabi-4_9-2015q3 | ||
LINK=https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update/+download/"${TARBALL}" | ||
CURDIR="$(pwd)" | ||
|
||
echo "${MD5SUM} ${TARBALL}" > md5.txt | ||
wget "${LINK}" | ||
md5sum -c md5.txt | ||
rm md5.txt | ||
|
||
tar xvjf "${TARBALL}" | ||
rm "${TARBALL}" | ||
|
||
if [ -n "${GITHUB_CI_PR_SHA}" ]; then | ||
# This is for GitHub Actions CI/CD tooling only | ||
echo "export PATH=\"${CURDIR}/${TARDIR}/bin\":\"\${PATH}\"" > build.env | ||
else | ||
# And this is for local install | ||
echo "" | ||
echo "Add a line like" | ||
echo "export PATH=\"${CURDIR}/${TARDIR}/bin\":\"\${PATH}\"" | ||
echo "to your ~/.profile and/or ~/.bashrc and run the line to enable toolchain as default one for arm-none-eabi-* target" | ||
echo "" | ||
fi; | ||
|
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