ci(travis): documentation check changes (#1062)

Essentially checking if the `yarn documentation` produces un-staged
files, if yes, then exiting with code 1.
This commit is contained in:
Benjamin Cabanes 2019-02-12 12:43:02 -05:00 committed by Jason Jean
parent 6b49e5f942
commit 0bbcacd954
3 changed files with 14 additions and 4 deletions

View File

@ -5,6 +5,8 @@ matrix:
node_js: 8.9.3 node_js: 8.9.3
dist: trusty dist: trusty
sudo: required sudo: required
addons:
chrome: stable
before_install: before_install:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then - if [ "$TRAVIS_OS_NAME" == "linux" ]; then
@ -20,9 +22,7 @@ script:
- yarn test - yarn test
- yarn e2e - yarn e2e
- yarn checkcommit - yarn checkcommit
- yarn documentation
addons:
chrome: stable
cache: cache:
directories: directories:

View File

@ -17,7 +17,7 @@
"test:nx": "yarn linknpm fast && ./scripts/test_nx.sh", "test:nx": "yarn linknpm fast && ./scripts/test_nx.sh",
"test": "yarn linknpm fast && ./scripts/test_nx.sh && ./scripts/test_schematics.sh", "test": "yarn linknpm fast && ./scripts/test_nx.sh && ./scripts/test_schematics.sh",
"checkformat": "./scripts/check_format.sh", "checkformat": "./scripts/check_format.sh",
"documentation": "./scripts/documentation/documentation.sh && yarn format" "documentation": "./scripts/documentation/documentation.sh && yarn format && ./scripts/documentation/check-documentation.sh"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/architect": "~0.12.2", "@angular-devkit/architect": "~0.12.2",

View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
if [ -z "$(git status --porcelain ./docs)" ]; then
echo "📄 Documentation not modified";
exit 0;
else
echo "📄 Documentation has been modified, you need to commit the changes.";
git status --porcelain ./docs
exit 1;
fi