FlowCI / flow-core-x

Powerful and user-friendly CI/CD server with high availability, parallel processing, runner auto-scaling
https://flowci.github.io
Apache License 2.0
1.61k stars 121 forks source link

Question: How to upload reports after failed step without allowing failures #394

Closed luke-riu closed 3 years ago

luke-riu commented 3 years ago

I have the following steps

to be able to upload the reports on a failed unit test, I need to set the unit tests as allow_failure: true which makes it so that the pipeline succeeds, which I don't want. Is there a way to run the following step and still show the fail X ? Thanks

gy2006 commented 3 years ago

Unfortunately, flow.ci doesn't support this scenario currently. It is a really good question, I'll consider it in the next release. Thanks 👍

luke-riu commented 3 years ago

Hi. I was wondering if this was resolved in the latest release. Thanks.

gy2006 commented 3 years ago

Hi, it has been solved by the post step which will be executed while the job goes to success, failed or cancelled status. you could have a post YAML block after steps, the YAML format is the same as step


envs:
  FLOW_WORKSPACE: "echo hello"
  FLOW_VERSION: "echo version"

docker:
  image: "helloworld:0.1"

steps:
  - name: clone
    bash: |
      echo "git clone"

post:
  - name: post-1
    bash: "echo post-1"

  - name: post-2
    condition: |
      return ${FLOWCI_STATUS} == "SUCCESS"
    bash: "echo post-2"
luke-riu commented 3 years ago

Perfect. This is exactly what I need. It might be useful to place examples like this in the template projects to showcase it's abilities 👍

gy2006 commented 3 years ago

exactly, I'm working on it