Skip to content

Commit cc6572d

Browse files
authored
Merge pull request #85 from Chisanan232/develop
[CU-86et1f7r5] Add reusable workflow parameter about working directory for shell script gets all tests.
2 parents c3299db + 5e1e58b commit cc6572d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.github/workflows/rw_get_tests.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# Run a specific shell script to get all test items.
55
#
66
# Workflow input parameters:
7+
# * test_working_directory: The working directory for test running.
78
# * shell_path: The file path of shell script which gets all the test items.
89
# * shell_arg: The arguments of the shell script which gets all the test items.
910
# * use_customized_shell: Don't use the shell script template project prepares, run customized shell script.
@@ -18,6 +19,11 @@ name: Prepare test items
1819
on:
1920
workflow_call:
2021
inputs:
22+
test_working_directory:
23+
description: "The working directory for test running."
24+
required: false
25+
type: string
26+
default: './'
2127
shell_path:
2228
description: "The file path of shell script which gets all the test items."
2329
required: false
@@ -53,6 +59,7 @@ jobs:
5359
run: curl https://raw.githubusercontent.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/develop/scripts/ci/get-all-tests.sh --output ${{ inputs.shell_path }}
5460

5561
- id: set-matrix
62+
working-directory: ${{ inputs.test_working_directory }}
5663
run: |
5764
sudo apt-get install jq
5865
echo "all_test_items=$(bash ${{ inputs.shell_path }} ${{ inputs.shell_arg }})" >> $GITHUB_OUTPUT

.github/workflows/rw_poetry_run_test.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
# * runtime_os: The OS to use for runtime environment. In default, it's 'ubuntu-latest'.
99
# * python_version: The Python version to run the workflow. In default, it's Python version '3.11'.
1010
# * test_type: The testing type. In generally, it only has 2 options: 'unit-test' and 'integration-test'.
11+
# * test_working_directory: The working directory for test running.
1112
# * install_dependency_with_group: Install the dependency by Poetry configuration with dependency group setting. This parameter receive the dependency group naming.
13+
# * install_dependency_without_group: Install the dependency by Poetry configuration without dependency group setting. This parameter receive the dependency group naming.
1214
# * all_test_items_paths: The target paths of test items under test.
1315
# * setup_http_server: If it's true, it would set up and run HTTP server for testing.
1416
# * http_server_host: The host IPv4 address of HTTP server.
@@ -51,7 +53,7 @@ on:
5153
description: "The working directory for test running."
5254
required: false
5355
type: string
54-
default: ''
56+
default: './'
5557
install_dependency_with_group:
5658
description: "Install the dependency by Poetry configuration with dependency group setting. This parameter receive the dependency group naming."
5759
type: string

0 commit comments

Comments
 (0)