I have a sample pipeline in gitlab. i want the the pipe to stop if any of the jobs fail. below is the code am using to replicate the scenario. the pipe does show failure as the status but the jobs continue to run even after a failed stage. example in the picture attached.
stages:
- unittest
- coverage_test
- static_code_analysis
variables:
skip_integration:
value: 'false'
description: "This variable for skipping integration tests"
skip_migration:
value: 'false'
unittest:
stage: unittest
script:
- echo "testing the code"
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
when: always
- if: '$skip_integration == "true"'
when: never
- if: '$skip_integration == "false"'
when: always
lint_test:
stage: static_code_analysis
allow_failure: false
script:
- echo "this is a test"
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
when: always
- if: '$skip_integration == "true"'
when: never
- if: '$skip_integration == "false"'
when: always
- when: on_success
coverage_test:
stage: coverage_test
script:
- echo00 "this is test again"
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
when: always
- if: '$skip_integration == "true"'
when: never
- if: '$skip_integration == "false"'
when: always
- when: on_success
but the pipe does not stop on failure.