Skip to content

Commit e33bf65

Browse files
committed
Checks that generation leads to the commited files
1 parent 279eefd commit e33bf65

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/vendor/
22
/build/
33
/doc/doc-en/
4+
/doc/entities/generated.ent

.travis.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,16 @@ script:
3131
#- "./vendor/bin/composer-require-checker --config-file=composer-require-checker.json"
3232
- composer cs-check
3333
- composer phpstan
34+
# Now, let's regenerate all files and see if we obtain the same set of files as the ones commited:
35+
- ./safe.php generate
36+
- |
37+
if output=$(git status --porcelain) && [ -z "$output" ]; then
38+
# all is good
39+
echo "Generated files are the same as committed file: OK"
40+
else
41+
# Uncommitted changes
42+
echo "Generated files are different from commited files. Please run './safe.php generate' command and commit the results."
43+
exit 1;
44+
fi
3445
after_script:
3546
- travis_retry php vendor/bin/php-coveralls

0 commit comments

Comments
 (0)