Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub Actions Disable Auto Cancel When Job Fails

I have the following GitHub Actions config file (parts removed for simplicity).

name: CI
on: push

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [8.x, 10.x, 12.x, 13.x]
    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
      - run: npm install
      - run: npm test

The major problem I'm running into is that lets say the test for Node.js version 8 fails. But the rest succeed. In that event GitHub Actions tends to cancel all the jobs if one job fails.

Is there a way to change this behavior so all jobs will continue to run even if one has a failure? This can be helpful in pinpointing an issue with a specific version.

like image 735
Charlie Fish Avatar asked Jan 26 '23 04:01

Charlie Fish


1 Answers

Adding fail-fast: false under strategy works fines for me! :)

name: CI
on: push

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node-version: [8.x, 10.x, 12.x, 13.x]
      fail-fast: false
    steps:
      - uses: actions/checkout@v2
      - name: Use Node.js
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
      - run: npm install
      - run: npm test
like image 127
Elley Avatar answered Jan 29 '23 09:01

Elley