Skip to content

Commit

Permalink
Avoid running test suite with doc only changes
Browse files Browse the repository at this point in the history
Note: Sometimes when PRs are rebased and force pushed the base of the
commit range may reference a commit which existed before the rebase.
Typically this isn't a problem but since CI repos start from scratch
that commit will probably not exist. When that occurs we can not
determine what files were changed so we automatically fall back to
running the test suite.
  • Loading branch information
omus committed Jun 14, 2018
1 parent 0658a11 commit e6b9395
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
9 changes: 7 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,19 @@ jobs:
ccache -s &&
make build-stats
- run: | # move source tree out of the way, run tests from install tree
COMMIT_RANGE=$(echo "${CIRCLE_COMPARE_URL}" | cut -d/ -f7) &&
[[ "$COMMIT_RANGE" != *"..."* ]] && COMMIT_RANGE="${COMMIT_RANGE}...${COMMIT_RANGE}";
FILES_CHANGED=$(git diff --name-only $COMMIT_RANGE -- || git ls-files) &&
cd .. &&
mv project julia-src &&
/tmp/julia/bin/julia -e 'Base.require(Main, :InteractiveUtils).versioninfo()' &&
/tmp/julia/bin/julia --sysimage-native-code=no -e 'true' &&
/tmp/julia/bin/julia-debug --sysimage-native-code=no -e 'true' &&
pushd /tmp/julia/share/julia/test &&
/tmp/julia/bin/julia --check-bounds=yes runtests.jl all --skip Sockets | bar -i 30 &&
/tmp/julia/bin/julia --check-bounds=yes runtests.jl LibGit2/online OldPkg/pkg Pkg/pkg download &&
if [ $(echo "$FILES_CHANGED" | grep -cv '^doc/') -gt 0 ]; then
/tmp/julia/bin/julia --check-bounds=yes runtests.jl all --skip Sockets | bar -i 30 &&
/tmp/julia/bin/julia --check-bounds=yes runtests.jl LibGit2/online OldPkg/pkg Pkg/pkg download;
fi &&
popd &&
mkdir /tmp/embedding-test &&
make check -C /tmp/julia/share/julia/test/embedding \
Expand Down
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,17 @@ script:
- du -sk /tmp/julia/*
- ls -l /tmp/julia/lib
- ls -l /tmp/julia/lib/julia
- FILES_CHANGED=$(git diff --name-only $TRAVIS_COMMIT_RANGE -- || git ls-files)
- cd .. && mv julia julia2
# run tests
- /tmp/julia/bin/julia --sysimage-native-code=no -e 'true' &&
/tmp/julia/bin/julia-debug --sysimage-native-code=no -e 'true'
- /tmp/julia/bin/julia -e 'Base.require(Main, :InteractiveUtils).versioninfo()'
- pushd /tmp/julia/share/julia/test
- /tmp/julia/bin/julia --check-bounds=yes runtests.jl $TESTSTORUN &&
/tmp/julia/bin/julia --check-bounds=yes runtests.jl LibGit2/online OldPkg/pkg Pkg/pkg download
# skip tests if only files within the "doc" dir have changed
- if [ $(echo "$FILES_CHANGED" | grep -cv '^doc/') -gt 0 ]; then
/tmp/julia/bin/julia --check-bounds=yes runtests.jl $TESTSTORUN &&
/tmp/julia/bin/julia --check-bounds=yes runtests.jl LibGit2/online OldPkg/pkg Pkg/pkg download; fi
- popd
# test that the embedding code works on our installation
- mkdir /tmp/embedding-test &&
Expand Down
6 changes: 6 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ branches:
- master
- /^release-.*/

# Note: use `[ci skip]` or `[skip ci]` anywhere in the commit message and AppVeyor won't be
# built for that commit. You can use `[skip appveyor]` to explicitly skip AppVeyor and
# allow other CI to still run.
skip_commits:
# Add [av skip] to commit messages for docfixes, etc to reduce load on queue
message: /\[av skip\]/
# Skip running CI for changes only to the documentation
files:
- doc/

notifications:
- provider: Email
Expand Down

0 comments on commit e6b9395

Please sign in to comment.