Github action step succeeds when it should have failed

I have a CI workflow that run unit tests. When the unit tests fail, the next step in the GH actions workflow should not proceed, and the workflow fails. Instead, the next steps are run, and the workflow fails.

Run: Add unit tests with github actions by nh13 · Pull Request #32 · fulcrumgenomics/sopt · GitHub

Screenshot:

This is a shell thing. To fix it you can replace this:

        run: |
          sbt +clean coverage +test && sbt coverageReport coverageAggregate

with this:

        run: |
          set -e
          sbt +clean coverage +test && sbt coverageReport coverageAggregate

I added set -e and it looks the run still fails:
The relevant portion of code is:

      - name: Unit Tests
        run: |
          set -e
          sbt +clean coverage +test && sbt coverageReport coverageAggregate
          find $HOME/.sbt -name "*.lock" | xargs rm
          find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm

Could it be because I have multiple commands?

Looks like multi-line is the issue. Here’s the run

      - name: Unit Tests
        run: |
          set -e
          sbt +clean coverage +test && sbt coverageReport coverageAggregate && (find $HOME/.sbt -name "*.lock" | xargs rm) && (find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm)