LoginSignup
4
4

More than 5 years have passed since last update.

circle-ciで複数のnode.jsバージョンで検証をしたい

Posted at

Travis.ciではできていた複数バージョンでのビルド。
「どーやるとできますかー」ってhelpで聞いてみたら、教えてくれた
(チャットっぽいヘルプUIすごい。circle-ciのサポート力高い。)

circle.yml
test:
  override:
    - nvm alias default 0.12.0
    - npm test
    - nvm alias default iojs-v1.3.0
    - npm test
    - nvm alias default 0.10.34
    - npm test

こんな感じ。
nvm入っているので切り替えていけばいい。

元々教えてもらったやり方だと、デフォルトのマシンを0.12.0にして最初のnvm切り替えを省略していたが、いまいち可読性が良くなかったので全部nvmで切り替えることにした。

もしparallelにやりたいならこうやると良いらしい。個人的に需要はなかったのでこれは試してない。

circle.yml
machine:
  node:
    version: 0.12.0

dependencies:
  pre:
    - if [ $CIRCLE_NODE_INDEX == "1" ] ; then nvm alias default iojs-v1.3.0 ; fi

test:
  override:
    - npm test:
        parallel: true
4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4