Skip to content

Commit

Permalink
Test only added and changed yaml files in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodion Iafarov committed Dec 7, 2020
1 parent 7afe9e2 commit 77878c9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,9 @@ test-compile-changed: os-autoinst/
test-yaml-valid:
@# Get list of changed yaml files. We only want to lint changed files for
@# now because yamllint complains about a lot of existing files
$(eval YAMLS=$(shell sh -c "git ls-files schedule/ test_data/ | grep '/.*\.y.\?ml$$'"))
export PERL5LIB=${PERL5LIB_} ; tools/test_yaml_valid $(YAMLS);\
$(eval CHANGED_YAMLS=$(shell sh -c "git --no-pager diff --diff-filter=dr --name-only FETCH_HEAD `git merge-base FETCH_HEAD origin/master` | grep '\(schedule\|test_data\)/.*\.y.\?ml$$'"))
if test -n "$(CHANGED_YAMLS)"; then \
export PERL5LIB=${PERL5LIB_} ; tools/test_yaml_valid $(CHANGED_YAMLS);\
which yamllint >/dev/null 2>&1 || echo "Command 'yamllint' not found, can not execute YAML syntax checks";\
yamllint -c .yamllint $(CHANGED_YAMLS);\
else \
Expand Down

0 comments on commit 77878c9

Please sign in to comment.