Skip to content

Commit e454e7d

Browse files
committed
✏️ Support setting the property *continue-on-error* at action step runs tests.
1 parent 04ddc85 commit e454e7d

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.github/workflows/rw_poetry_run_test.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# * http_server_port: The port number of HTTP server.
1515
# * http_server_app_module: The module path of HTTP server.
1616
# * http_server_enter_point: The object about the web application.
17+
# * keep_run_if_test_fail: Keep running CI process if it gets failure at running runs.
1718
#
1819
# Workflow running output:
1920
# No, but it would save the testing coverage reports to provide after-process to organize and record.
@@ -74,6 +75,11 @@ on:
7475
type: string
7576
required: false
7677
default: app
78+
keep_run_if_test_fail:
79+
description: "Keep running CI process if it gets failure at running runs."
80+
type: boolean
81+
required: false
82+
default: false
7783

7884
# TODO: Add a reusable workflow about running test via Poetry
7985
# TODO: https://github.com/marketplace/actions/python-poetry-action
@@ -119,7 +125,7 @@ jobs:
119125

120126
- name: Run tests with pytest
121127
run: poetry run pytest ${{ matrix.test-path }}
122-
continue-on-error: true
128+
continue-on-error: ${{ inputs.keep_run_if_test_fail }}
123129

124130
- name: Rename the code coverage result file
125131
run: |

.github/workflows/rw_run_test.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# * http_server_port: The port number of HTTP server.
1515
# * http_server_app_module: The module path of HTTP server.
1616
# * http_server_enter_point: The object about the web application.
17+
# * keep_run_if_test_fail: Keep running CI process if it gets failure at running runs.
1718
#
1819
# Workflow running output:
1920
# No, but it would save the testing coverage reports to provide after-process to organize and record.
@@ -72,6 +73,11 @@ on:
7273
type: string
7374
required: false
7475
default: app
76+
keep_run_if_test_fail:
77+
description: "Keep running CI process if it gets failure at running runs."
78+
type: boolean
79+
required: false
80+
default: false
7581

7682
env:
7783
PIP_DISABLE_PIP_VERSION_CHECK: 1
@@ -110,7 +116,7 @@ jobs:
110116

111117
- name: Run tests with pytest
112118
run: pytest ${{ matrix.test-path }}
113-
continue-on-error: true
119+
continue-on-error: ${{ inputs.keep_run_if_test_fail }}
114120

115121
- name: Rename the code coverage result file
116122
run: mv ./.coverage ./.coverage.${{ inputs.test_type }}.${{ inputs.runtime_os }}-${{ inputs.python_version }}

0 commit comments

Comments
 (0)