【问题标题】:Stack with Travis CI与 Travis CI 堆叠
【发布时间】:2016-08-14 22:37:40
【问题描述】:

我最近一直在尝试将 travis 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'

当我将它们推送到 git 时测试无法运行,travis CI 尝试构建我的 repo,但是当我检查日志时它说它找不到堆栈命令。

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

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

【问题讨论】:

  • StackOverflow 问题应该大部分是独立的;请将.travis.yml 减少为实际可以在此处发布的内容。
  • 您能否给出您尝试在 Travis CI 文件中调用 Stack 的文件的相关部分以及您从该调用中得到的错误消息?

标签: haskell continuous-integration travis-ci hunit


【解决方案1】:

我也见过这个。

[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

【讨论】:

  • 感谢.travis.yml!如果我可以问,为什么language: c
  • 这只是 Travis CI 的某种最低公分母。即最小的依赖关系
猜你喜欢
  • 2015-03-28
  • 1970-01-01
  • 2014-04-02
  • 1970-01-01
  • 2012-09-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-05-25
相关资源
最近更新 更多