Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
lerwys committed Mar 20, 2020
2 parents 0a82818 + 4a6eb90 commit e97b2b2
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 28 deletions.
17 changes: 10 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@ env:
- BUILD_DIR=build
- RELEASE_DIR=release
jobs:
- BUILD_TYPE='Release' BOARD='afc-bpm' -VERSION='3.0' -RTM=''
- BUILD_TYPE='Release' BOARD='afc-bpm' -VERSION='3.1' -RTM=''
- BUILD_TYPE='Release' BOARD='afc-timing' -VERSION='' -RTM='rtm-8sfp'
- BUILD_ARTIFACT='binary' BUILD_TYPE='Release' BOARD='afc-bpm' VERSION='3.0' RTM=''
- BUILD_ARTIFACT='binary' BUILD_TYPE='Release' BOARD='afc-bpm' VERSION='3.1' RTM=''
- BUILD_ARTIFACT='binary' BUILD_TYPE='Release' BOARD='afc-timing' VERSION='' RTM='rtm-8sfp'

jobs:
include:
- env: DEPLOY='all'
- env: BUILD_ARTIFACT='all_binaries' DEPLOY='all_binaries'
- env: BUILD_ARTIFACT='docs' DEPLOY='docs'

# Install dependencies
addons:
Expand All @@ -37,14 +38,15 @@ addons:
- doxygen-gui
- graphviz

# Build and check this project
# Build and check this project
script:
- ./ci_build.sh

# Generate and deploy documentation
# Generate documentation
after_success:
- ./ci_gen_doxy.sh

# Prepare for deploy
before_deploy:
- . ./ci_deploy.sh

Expand All @@ -57,7 +59,7 @@ deploy:
on:
all_branches: true
tags: true
condition: $DEPLOY = "all"
condition: $DEPLOY = "all_binaries"

- provider: pages
skip_cleanup: true
Expand All @@ -66,3 +68,4 @@ deploy:
keep_history: false
on:
all_branches: true
condition: $DEPLOY = "docs"
45 changes: 27 additions & 18 deletions ci_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ BUILDS[debug-afc-timing-${GIT_DESCRIBE}]="\

TOP=$(pwd)

case "${DEPLOY}" in
all)
# Generate builds for all list items
case "${BUILD_ARTIFACT}" in
# Generate builds for all list items. Both "all_binaries"
# and "docs" needs to build everyting and pass all tests.
all_binaries|docs)
for build in "${!BUILDS[@]}"; do
echo "Generating build for:" ${build} && \
mkdir -p ${BUILD_DIR}-${build} && \
Expand All @@ -66,25 +67,28 @@ case "${DEPLOY}" in
cd ${TOP}
done

# Copy the generated files to the release folder
mkdir -p ${RELEASE_DIR}
for build in "${!BUILDS[@]}"; do
case "${build}" in
debug*)
cp ${BUILD_DIR}-${build}/out/openMMC.axf ${RELEASE_DIR}/openMMC-${build}.axf
;;

*)
cp ${BUILD_DIR}-${build}/out/openMMC.bin ${RELEASE_DIR}/openMMC-${build}.bin
cp ${BUILD_DIR}-${build}/out/openMMC_full.bin ${RELEASE_DIR}/openMMC-full-${build}.bin
;;
esac
done
# Extra step for "all_binaries" is to copy
# the artifacts to a release folder
if [ "${BUILD_ARTIFACT}" = "all_binaries" ]; then
# Copy the generated files to the release folder
mkdir -p ${RELEASE_DIR}
for build in "${!BUILDS[@]}"; do
case "${build}" in
debug*)
cp ${BUILD_DIR}-${build}/out/openMMC.axf ${RELEASE_DIR}/openMMC-${build}.axf
;;

*)
cp ${BUILD_DIR}-${build}/out/openMMC.bin ${RELEASE_DIR}/openMMC-${build}.bin
cp ${BUILD_DIR}-${build}/out/openMMC_full.bin ${RELEASE_DIR}/openMMC-full-${build}.bin
;;
esac
done
fi
;;

# Regular build
*)
binary)
mkdir -p ${BUILD_DIR} && \
cd ${BUILD_DIR} && \
cmake ../ \
Expand All @@ -95,4 +99,9 @@ case "${DEPLOY}" in
make
;;

*)
echo "BUILD_ARTIFACT invalid: "${BUILD_ARTIFACT}
exit 0
;;

esac
2 changes: 1 addition & 1 deletion ci_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -x

TOP=$(pwd)

if [ "${DEPLOY}" = "all" ]; then
if [ "${DEPLOY}" = "all_binaries" ]; then
mkdir dist
export OPENMMC_DEPLOYMENT=dist/*

Expand Down
16 changes: 14 additions & 2 deletions ci_gen_doxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ set -x
set -e
set -o

cd $TRAVIS_BUILD_DIR/docs && \
doxygen Doxyfile.dox && \
if [ "${BUILD_ARTIFACT}" = "docs" ]; then
# remove build directories, as we can't
# use a file pattern in Doxyfile.dox file
# like */build*/* as travis seems to be
# expanding "*". This should be safe, as
# we only run this when BUILD_ARTIFACT is set
# to "docs" and not with "all_binaries", which
# is the release BUILD_ARTIFACT
rm -r $TRAVIS_BUILD_DIR/${BUILD_DIR}*

# Now generate the documentation
cd $TRAVIS_BUILD_DIR/docs
doxygen Doxyfile.dox
echo "" > html/.nojekyll
fi

0 comments on commit e97b2b2

Please sign in to comment.