diff --git a/.travis.yml b/.travis.yml index 1653d104e8..a3ee330bfd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,6 +40,13 @@ before_install: wget https://github.com/vmt/udis86/archive/v1.7.2.tar.gz && tar xzvf v1.7.2.tar.gz && ( cd udis86-1.7.2/ && ./autogen.sh && ./configure --enable-shared=yes && make && sudo make install ) && ( [[ "$TRAVIS_OS_NAME" != "osx" ]] && sudo ldconfig || true ) + - git remote set-branches --add origin master + - git fetch # so we can see which vocabs changed versus origin/master... script: + - echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, TRAVIS_PULL_REQUEST_BRANCH=$TRAVIS_PULL_REQUEST_BRANCH" + - export CI_BRANCH="${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" + - echo "CI_BRANCH=${CI_BRANCH}" - DEBUG=1 ./build.sh net-bootstrap < /dev/null - - ./factor -run=zealot.cli-changed-vocabs | while read line ; do ./factor -e="USING: kernel tools.test vocabs.hierarchy ; \"$line\" [ load ] [ test ] bi" ; done + - "./factor -e='USING: memory vocabs.hierarchy ; \"zealot\" load save'" + - ./factor -run=zealot.cli-changed-vocabs + - ./factor -run=zealot.cli-test-changed-vocabs diff --git a/build.sh b/build.sh index 7b1c5632da..97a4a719ea 100755 --- a/build.sh +++ b/build.sh @@ -590,10 +590,10 @@ set_boot_image_vars() { } set_current_branch() { - if [ -z ${TRAVIS_BRANCH} ]; then - CURRENT_BRANCH=$(current_git_branch) + if [ -n "${CI_BRANCH}" ]; then + CURRENT_BRANCH="${CI_BRANCH}" else - CURRENT_BRANCH=${TRAVIS_BRANCH} + CURRENT_BRANCH=$(current_git_branch) fi } diff --git a/extra/cli/git/git.factor b/extra/cli/git/git.factor index 2ea02a53cf..bfee6419ff 100644 --- a/extra/cli/git/git.factor +++ b/extra/cli/git/git.factor @@ -45,8 +45,7 @@ cli-git-num-parallel [ cpus 2 * ] initialize ?file-info dup [ directory? ] when ; : git-current-branch* ( -- name ) - ! { "git" "rev-parse" "--abbrev-ref" "HEAD" } - { "git" "name-rev" "--name-only" "HEAD" } git-command>string ; + { "git" "rev-parse" "--abbrev-ref" "HEAD" } git-command>string ; : git-current-branch ( directory -- name ) [ git-current-branch* ] with-directory ; diff --git a/extra/zealot/cli-test-changed-vocabs/authors.txt b/extra/zealot/cli-test-changed-vocabs/authors.txt new file mode 100644 index 0000000000..7c1b2f2279 --- /dev/null +++ b/extra/zealot/cli-test-changed-vocabs/authors.txt @@ -0,0 +1 @@ +Doug Coleman diff --git a/extra/zealot/cli-test-changed-vocabs/cli-test-changed-vocabs.factor b/extra/zealot/cli-test-changed-vocabs/cli-test-changed-vocabs.factor new file mode 100644 index 0000000000..200313c55e --- /dev/null +++ b/extra/zealot/cli-test-changed-vocabs/cli-test-changed-vocabs.factor @@ -0,0 +1,13 @@ +! Copyright (C) 2018 Doug Coleman. +! See http://factorcode.org/license.txt for BSD license. +USING: kernel sequences tools.test vocabs zealot.factor ; +IN: zealot.cli-test-changed-vocabs + +: zealot-test-changed-vocabs ( -- ) + ci-vocabs-to-test [ + [ require ] each + ] [ + [ test ] each + ] bi ; + +MAIN: zealot-test-changed-vocabs \ No newline at end of file diff --git a/extra/zealot/factor/factor.factor b/extra/zealot/factor/factor.factor index a4fc2a7e15..4382e94237 100644 --- a/extra/zealot/factor/factor.factor +++ b/extra/zealot/factor/factor.factor @@ -1,11 +1,12 @@ ! Copyright (C) 2017 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors arrays bootstrap.image calendar cli.git -combinators concurrency.combinators formatting fry http.client -io io.directories io.launcher io.pathnames kernel math.parser -memory modern.paths namespaces parser.notes prettyprint -sequences sequences.extras sets splitting system system-info -threads tools.test tools.test.private vocabs vocabs.hierarchy +USING: accessors arrays bootstrap.image bootstrap.image.upload +calendar cli.git combinators concurrency.combinators environment +formatting fry http.client io io.directories io.launcher +io.pathnames kernel math.parser memory modern.paths namespaces +parser.notes prettyprint sequences sequences.extras sets +splitting system system-info threads tools.test +tools.test.private vocabs vocabs.hierarchy vocabs.hierarchy.private vocabs.loader vocabs.metadata zealot ; IN: zealot.factor @@ -187,7 +188,7 @@ M: windows factor-path "./factor.com" ; [ path-separator split harvest "." join ] map members ; : changed-factor-vocabs-from-master ( -- vocabs ) - "master" "origin/master" changed-factor-vocabs ; + "HEAD" "origin/master" changed-factor-vocabs ; : reject-unloadable-vocabs ( vocabs -- vocabs' ) [ don't-load? ] reject ;