mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-07-28 04:07:47 +00:00
[Docs] Add Travis check for documentation and stop build for docs only
Let Travis build the documentation and prevent full build when only documentation changed.
This commit is contained in:
+2
-1
@@ -22,7 +22,7 @@ addons:
|
||||
|
||||
|
||||
install:
|
||||
- pip install -U platformio
|
||||
- pip install -U platformio sphinx recommonmark sphinx_bootstrap_theme
|
||||
|
||||
script:
|
||||
# - cppcheck --enable=warning src/*.ino -q --force -I src --include=src/ESPEasy.ino --error-exitcode=1
|
||||
@@ -37,6 +37,7 @@ script:
|
||||
|
||||
|
||||
before_deploy:
|
||||
- bash ./preflight.sh # make sure input files are OK before wasting time with prereqs
|
||||
- ./before_deploy
|
||||
- export RELEASE_FILE=$(ls ESPEasy*.zip)
|
||||
|
||||
|
||||
+5
-2
@@ -35,10 +35,13 @@ done
|
||||
|
||||
|
||||
#create a source structure that is the same as the original ESPEasy project (and works with the howto on the wiki)
|
||||
rm -rf dist/Source 2>/dev/null
|
||||
mkdir dist/Source
|
||||
rm -rf dist/* 2>/dev/null
|
||||
|
||||
mkdir -p dist/Source
|
||||
mkdir -p dist/Docs
|
||||
cp -r lib dist/Source/
|
||||
cp -r src dist/Source/
|
||||
cp -r docs/build/ dist/Docs/
|
||||
cp platformio.ini dist/Source/
|
||||
|
||||
cd dist
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check for documentation only changes.
|
||||
# Source: https://github.com/dev-id/Magic-Spoiler/blob/8111a06ab6682e020169991d5e2aa4fa503d787f/preflight.sh
|
||||
|
||||
set -e
|
||||
MAIN_BRANCH="mega"
|
||||
MD=".md$"
|
||||
DOCS="^docs/"
|
||||
|
||||
CHANGED_FILES=`git diff --name-only ${MAIN_BRANCH}...${TRAVIS_COMMIT}`
|
||||
ONLY_READMES=True
|
||||
DOCUMENTATION_CHANGED=False
|
||||
|
||||
for CHANGED_FILE in $CHANGED_FILES; do
|
||||
if ! [[ $CHANGED_FILE =~ $MD || $CHANGED_FILE =~ $DOCS ]]; then
|
||||
ONLY_READMES=False
|
||||
break
|
||||
else
|
||||
DOCUMENTATION_CHANGED=True
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ $ONLY_READMES == True ]]; then
|
||||
echo "Only documentation files found, exiting."
|
||||
travis_terminate 0
|
||||
exit 1
|
||||
else
|
||||
echo "Non-documentation files found, continuing with build."
|
||||
fi
|
||||
|
||||
if [[ $DOCUMENTATION_CHANGED == True ]]; then
|
||||
echo "Generate documentation."
|
||||
cd docs
|
||||
./make html
|
||||
fi
|
||||
Reference in New Issue
Block a user