2016-08-11 103 views
5

我最近一直在尝试使用travis CI与堆栈,我有 一直在运行一些问题。堆栈与特拉维斯CI

我.travis.yml文件位于我的回购是在这里: (我使用的堆栈网站上的指南) 我的配置文件的快照如下:

sudo: false 

# Caching so the next build will be fast too. 
cache: 
    directories: 
    - $HOME/.stack 

before_install: 
# Download and unpack the stack executable 
- mkdir -p ~/.local/bin 
- export PATH=$HOME/.local/bin:$PATH 
- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' 

测试当我将它们推到混帐时失败,travis CI尝试构建我的repo,但是当我检查日志时,它说它无法找到堆栈命令。

但是在我指定的配置文件中安装堆栈。

我不确定为什么发生这种情况,任何帮助将不胜感激?

+0

StackOverflow的问题,应主要自足;请将'.travis.yml'减少为实际可以在此发布的内容。 – leftaroundabout

+0

你可以给你在Travis CI文件中试图调用Stack的文件的相关部分以及从该调用中获得的错误消息吗? –

回答

3

我也见过这个。

[0K$ travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | \ tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' 
/home/travis/build.sh: line 45: tar: command not found 
    % Total % Received % Xferd Average Speed Time Time  Time Current 
           Dload Upload Total Spent Left Speed 

    0  0 0  0 0  0  0  0 --:--:-- --:--:-- --:--:--  0 
    0  0 0  0 0  0  0  0 --:--:-- --:--:-- --:--:--  0 

    0  0 0 607 0  0 7527  0 --:--:-- --:--:-- --:--:-- 7527 

    0 9223k 0  0 0  0  0  0 --:--:-- --:--:-- --:--:--  0 
[31;1mThe command "curl -L https://www.stackage.org/stack/linux-x86_64" failed. Retrying, 2 of 3.[0m 

    % Total % Received % Xferd Average Speed Time Time  Time Current 
           Dload Upload Total Spent Left Speed 

    0  0 0  0 0  0  0  0 --:--:-- --:--:-- --:--:--  0 
    0  0 0  0 0  0  0  0 --:--:-- --:--:-- --:--:--  0 

    0  0 0 607 0  0 9491  0 --:--:-- --:--:-- --:--:-- 9491 

[31;1mThe command "curl -L https://www.stackage.org/stack/linux-x86_64" failed. Retrying, 3 of 3.[0m 

    % Total % Received % Xferd Average Speed Time Time  Time Current 
           Dload Upload Total Spent Left Speed 

    0  0 0  0 0  0  0  0 --:--:-- --:--:-- --:--:--  0 
    0  0 0  0 0  0  0  0 --:--:-- --:--:-- --:--:--  0 

    0  0 0 607 0  0 11999  0 --:--:-- --:--:-- --:--:-- 11999 

[31;1mThe command "curl -L https://www.stackage.org/stack/linux-x86_64" failed 3 times. 

这是当curl由于某种类型的网络问题。重新开始构建,并希望下次有更好的运气。

如果人们有兴趣,这里是我的完整,但最小.travis.yml

sudo: false 

language: c 

cache: 
    directories: 
    - ~/.stack 

addons: 
    apt: 
    packages: 
     - libgmp-dev 

before_install: 
    # Download and unpack the stack executable 
    - mkdir -p ~/.local/bin 
    - export PATH=$HOME/.local/bin:$PATH 
    - travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack' 

install: 
    - stack --no-terminal --install-ghc test --only-dependencies 

script: 
    - stack --no-terminal test --haddock --no-haddock-deps