'Marking GitHub actions workflow as failed if a single job fails in matrix

When running a GitHub Actions matrix workflow, how can we allow a job to fail, continue running all the other jobs, and also mark the workflow itself as failed?

Below in this image, you can see that the workflow passes even after a job failed. We need to mark the workflow as failed in this case.

Image of our workflow results

Here is the small portion of my workflow yaml file. continue-on-error line will continue the workflow even if a job fails but how do we get the whole workflow marked as failed?

   matrixed:
    runs-on: ubuntu-latest
    continue-on-error: true  
    timeout-minutes: 60
    defaults:
      run:
        shell: bash
        working-directory: myDir

    strategy:
      matrix:
        testgroups:
          [
            "bookingpage-docker-hub-parallel",
            "bookingpage-docker-hub-parallel-group-1",
            "bookingpage-payments",
          ]

I did find this unanswered question, but this is about steps and we need to know about jobs.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source