LoginSignup
17
5

More than 3 years have passed since last update.

GitHub ActionsのMatrixビルドであるJobがコケても他のJob(s)をcancelさせない方法

Last updated at Posted at 2020-08-12

GitHub ActionsのMatrixビルドで複数Jobが並列で走ったとき、あるJobがfailするとデフォルトでは他のJobは途中でCancelされてしまう。もしそれら複数Jobが特に依存関係ない場合はCancelにしたくないのではないかと思う。これを実現するのがfail-fastオプション。

jobs.<job_id>.strategy.fail-fast

When set to true, GitHub cancels all in-progress jobs if any matrix job fails. Default: true

ref: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast

Matrixビルドにおいて、fail-fastは特に指定しなければtrue、つまりあるJobがfailすると他のJobは途中であってもCancelする。これをfalseにすることでこの動きを止めることができる、つまりあるJobがfailしても他のJobはcancelされず最後まで処理が継続される。

strategy:
  fail-fast: false
  matrix:
    node: [11, 12]
    os: [macos-latest, ubuntu-18.04]

以上、Happy GitHub Actions!

17
5
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
17
5