forked from DangerousPrototypes/Bus_Pirate
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Build on CircleCI with XC16 1.35 and MPLABX 5
- Loading branch information
Showing
3 changed files
with
167 additions
and
0 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,163 @@ | ||
version: 2 | ||
|
||
shared: &shared | ||
docker: | ||
- image: debian:stretch | ||
environment: &shared_environment | ||
CLICOLOR_FORCE: 1 | ||
mplabx_dir: /opt/mplabx | ||
|
||
steps: | ||
- run: | ||
name: Install dependencies | ||
command: | | ||
dpkg --add-architecture i386 | ||
apt-get update | ||
apt-get install -y --no-install-recommends \ | ||
wget \ | ||
git \ | ||
ca-certificates \ | ||
libc6:i386 \ | ||
make \ | ||
procps \ | ||
- checkout | ||
|
||
- restore_cache: | ||
name: Restore XC16 installation from cache | ||
keys: | ||
- xc16-{{ checksum ".circleci/xc16.envs" }} | ||
- run: | ||
name: Install XC16 | ||
command: | | ||
source ./.circleci/xc16.envs | ||
url="https://ww1.microchip.com/downloads/en/DeviceDoc/xc16-v${xc16_version}-full-install-linux-installer.run" | ||
xc16_inst='/tmp/xc16' | ||
xc16_install_marker="/opt/microchip/xc16/hash-$xc16_inst_sha256" | ||
if [ -f "$xc16_install_marker" ]; then | ||
echo 'XC16 in cache' | ||
exit 0 | ||
fi | ||
wget -O "$xc16_inst" "$url" | ||
chmod +x "$xc16_inst" | ||
sha256sum -c <(echo "${xc16_inst_sha256} *${xc16_inst}") | ||
"$xc16_inst" --version | ||
"$xc16_inst" \ | ||
--mode unattended \ | ||
--unattendedmodeui none \ | ||
--netservername localhost \ | ||
--LicenseType FreeMode \ | ||
rm -fv "$xc16_inst" | ||
touch "$xc16_install_marker" | ||
- save_cache: | ||
name: Save XC16 installation to cache | ||
key: xc16-{{ checksum ".circleci/xc16.envs" }} | ||
paths: | ||
- /opt/microchip | ||
|
||
- restore_cache: | ||
name: Restore MBLAB X installation from cache | ||
keys: | ||
- mplabx-{{ checksum ".circleci/mplabx.envs" }} | ||
- run: | ||
name: Install MPLAB X | ||
command: | | ||
source ./.circleci/mplabx.envs | ||
mplabx_url="https://ww1.microchip.com/downloads/en/DeviceDoc/MPLABX-v${mplabx_version}-linux-installer.tar" | ||
mplabx_tar='mplabx.tar' | ||
mplabx_inst="./MPLABX-v${mplabx_version}-linux-installer.sh" | ||
mplabx_install_marker="$mplabx_dir/hash-$mplabx_tar_sha256" | ||
if [ -f "$mplabx_install_marker" ]; then | ||
echo 'MPLABX in cache' | ||
exit 0 | ||
fi | ||
wget -O "$mplabx_tar" "$mplabx_url" | ||
sha256sum -c <(echo "${mplabx_tar_sha256} *${mplabx_tar}") | ||
tar xf "$mplabx_tar" | ||
USER=root "$mplabx_inst" --nolibrarycheck -- --version | ||
USER=root "$mplabx_inst" --nolibrarycheck --nox11 -- \ | ||
--unattendedmodeui none \ | ||
--mode unattended \ | ||
--ipe 0 \ | ||
--installdir "$mplabx_dir" \ | ||
rm -fv "$mplabx_tar" "$mplabx_inst" | ||
touch "$mplabx_install_marker" | ||
- save_cache: | ||
name: Save MPLAB X installation to cache | ||
key: mplabx-{{ checksum ".circleci/mplabx.envs" }} | ||
paths: | ||
- /opt/mplabx | ||
|
||
- run: | ||
name: Configure | ||
command: | | ||
$mplabx_dir/mplab_platform/bin/prjMakefilesGenerator.sh -v "$project_dir" | ||
- run: | ||
name: Build | ||
command: | | ||
make -C "$project_dir" CONF="$build_config" build | ||
- run: | ||
name: Prepare artifacts | ||
command: | | ||
# part of this is a workaround for CircleCI not supporting string interpolation or symlinks in store_artifacts | ||
artifacts_dir="${project_dir}/dist/${build_config}/production" | ||
git_describe="$(git describe --tags --always --long)" | ||
mkdir ./artifacts/ | ||
for file in $artifacts_dir/*; do | ||
filename=$(basename -- "$file") | ||
extension="${filename##*.}" | ||
filename="${filename%.*}" | ||
cp -av "$file" "./artifacts/${CIRCLE_JOB}-${filename}-${git_describe}-${CIRCLE_BUILD_NUM}.${extension}" | ||
done | ||
- store_artifacts: | ||
path: ./artifacts/ | ||
destination: artifacts | ||
|
||
|
||
|
||
jobs: | ||
firmware-bp-v4: | ||
<<: *shared | ||
environment: | ||
<<: *shared_environment | ||
build_config: BusPirate_v4 | ||
project_dir: ./Firmware/busPirate.X | ||
|
||
firmware-bp-v3: | ||
<<: *shared | ||
environment: | ||
<<: *shared_environment | ||
build_config: BusPirate_v3 | ||
project_dir: ./Firmware/busPirate.X | ||
|
||
boot-bp-v4: | ||
<<: *shared | ||
environment: | ||
<<: *shared_environment | ||
build_config: default | ||
project_dir: ./Bootloaders/BPv4-bootloader/firmware-v1/bpv4-bootloader.X | ||
|
||
boot-bp-v3: | ||
<<: *shared | ||
environment: | ||
<<: *shared_environment | ||
build_config: default | ||
project_dir: ./Bootloaders/BPv3-bootloader/firmware-v4.5/ds30loader.X | ||
|
||
workflows: | ||
version: 2 | ||
build: | ||
jobs: | ||
- firmware-bp-v4 | ||
- firmware-bp-v3 | ||
- boot-bp-v4 | ||
- boot-bp-v3 | ||
|
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,2 @@ | ||
mplabx_version='5.00' | ||
mplabx_tar_sha256='645ecd31dd9edbe7545300f6e3ee10f9329a078d19c1ebac4d3c34d32dd38ce7' |
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,2 @@ | ||
xc16_version='1.35' | ||
xc16_inst_sha256='c681d2c132edcd8659487e08b531add76cd154329da5457f77527a60b6c24aed' |