From eb121e6fe2713258466ce42cbbd3738671ddcb9b Mon Sep 17 00:00:00 2001 From: Chisanan232 Date: Mon, 30 Oct 2023 22:38:40 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E2=9E=95=20Add=20content=20about=20running?= =?UTF-8?q?=20test=20by=20Poetry=20in=20README.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 76080abf..ecdd049e 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?logo=apache)](https://opensource.org/licenses/Apache-2.0) [![Python project CI Test (one-test)](https://github.com/Chisanan232/GitHub-Action_Workflow-Template-Python/actions/workflows/test_python_project_ci_one-test.yaml/badge.svg)](https://github.com/Chisanan232/GitHub-Action_Workflow-Template-Python/actions/workflows/test_python_project_ci_one-test.yaml) [![Python project CI Test (multi-tests)](https://github.com/Chisanan232/GitHub-Action_Workflow-Template-Python/actions/workflows/test_python_project_ci_multi-tests.yaml/badge.svg)](https://github.com/Chisanan232/GitHub-Action_Workflow-Template-Python/actions/workflows/test_python_project_ci_multi-tests.yaml) +[![Python project with Poetry CI Test (multi-tests)](https://github.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/actions/workflows/test_pyproject_ci_multi-tests_by_poetry.yaml/badge.svg)](https://github.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/actions/workflows/test_pyproject_ci_multi-tests_by_poetry.yaml) [![GitHub Action reusable workflow project CI Test](https://github.com/Chisanan232/GitHub-Action_Workflow-Template-Python/actions/workflows/test_gh_reusable_workflow.yaml/badge.svg)](https://github.com/Chisanan232/GitHub-Action_Workflow-Template-Python/actions/workflows/test_gh_reusable_workflow.yaml) @@ -28,6 +29,7 @@ The usage of each workflow template. * [_rw_get_tests.yaml_](#rw_get_testsyaml) * [_rw_run_test.yaml_](#rw_run_testyaml) +* [_rw_poetry_run_test.yaml_](#rw_poetry_run_testyaml) * [_rw_organize_test_cov_reports.yaml_](#rw_organize_test_cov_reportsyaml) * [_rw_upload_test_cov_report.yaml_](#rw_upload_test_cov_reportyaml) * [_rw_pre-building_test.yaml_](#rw_pre-building_testyaml) @@ -129,10 +131,17 @@ is provided by previous workflow? That is all testing items. | Workflow | Running way | Support Python version | |-----------------------------------|---------------------------------------------------|------------------------| -| _rw_run_test.yaml_ | Command lines like ``pip``, ``python``, etc | 3.6 - 3.11 | +| _rw_run_test.yaml_ | Command lines like ``pip``, ``python``, etc | 3.6 - 3.11 | | _poetry_run_test_via_pytest.yaml_ | Use ``poetry`` feature or run command lines in it | 3.8 - 3.11 | +
+ +### _rw_poetry_run_test.yaml_ + +* Description: Same working with workflow _rw_run_test.yaml_, but this workflow would run test via **_Poetry_**. + +
### _rw_organize_test_cov_reports.yaml_ From 97d94f94d521c17ce4b536a33099ddeb79f05a3b Mon Sep 17 00:00:00 2001 From: Chisanan232 Date: Mon, 30 Oct 2023 22:48:58 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20=20Update=20the=20usag?= =?UTF-8?q?e=20to=20get=20all=20tests=20in=20README.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 46 ++++++++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index ecdd049e..28261221 100644 --- a/README.md +++ b/README.md @@ -44,28 +44,46 @@ The usage of each workflow template. * Description: Prepare the test items. * Options: -| option name | data type | optional or required | function content | -|-------------|-----------|----------------------|------------------------------------------------------| -| shell_path | string | Required | The path shell script for getting the testing items. | -| shell_arg | string | Required | Input arguments of the shell script. | +| option name | data type | optional or required | function content | +|----------------------|-----------|------------------------------------------------------------|-----------------------------------------------------------| +| shell_path | string | Optional, Default value is _./scripts/ci/get-all-tests.sh_ | The path shell script for getting the testing items. | +| shell_arg | string | Required | Input arguments of the shell script. | +| use_customized_shell | boolean | Optional, Default value is _false_ | Whether it should use the customized shell script or not. | * Output: * all_test_items: All the test items it would run. * How to use it? -Before use this workflow, it should prepare a shell script for getting the testing items. + * Use default shell script (recommended) -```yaml - prepare-testing-items_unit-test: -# name: Prepare all unit test items - uses: Chisanan232/GitHub-Action-Template-Python/.github/workflows/rw_get_tests.yaml@master - with: - shell_path: scripts/ci/get-unit-test-paths.sh - shell_arg: unix -``` + If we want to use default shell script to auto-scan all tests, it only needs to give a shell script argument which is the directory path of test code: + + ```yaml + prepare-testing-items_unit-test: + # name: Prepare all unit test items + uses: Chisanan232/GitHub-Action-Template-Python/.github/workflows/rw_get_tests.yaml@master + with: + shell_arg: test/unit_test/ + ``` + + And it would get all tests you need. And the keyword to get this workflow output result is _all_test_items_. + + * Use customized shell script + + Before use this workflow, it should prepare a shell script for getting the testing items. + + ```yaml + prepare-testing-items_unit-test: + # name: Prepare all unit test items + uses: Chisanan232/GitHub-Action-Template-Python/.github/workflows/rw_get_tests.yaml@master + with: + shell_path: scripts/ci/get-unit-test-paths.sh + shell_arg: unix + use_customized_shell: true + ``` -And we could get this workflow output result via keyword _all_test_items_. + And we could get this workflow output result via keyword _all_test_items_.
From a5e74b3c6568e9d10f8ec708363e9e2f50fb6662 Mon Sep 17 00:00:00 2001 From: Chisanan232 Date: Tue, 31 Oct 2023 07:35:16 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20=20Update=20the=20disp?= =?UTF-8?q?lay=20format=20to=20display=20the=20testing=20state.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 28261221..034322a4 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,16 @@ [![Release](https://img.shields.io/github/release/Chisanan232/GitHub-Action-Template-Python.svg?label=Release&logo=github)](https://github.com/Chisanan232/GitHub-Action-Template-Python/releases) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?logo=apache)](https://opensource.org/licenses/Apache-2.0) -[![Python project CI Test (one-test)](https://github.com/Chisanan232/GitHub-Action_Workflow-Template-Python/actions/workflows/test_python_project_ci_one-test.yaml/badge.svg)](https://github.com/Chisanan232/GitHub-Action_Workflow-Template-Python/actions/workflows/test_python_project_ci_one-test.yaml) -[![Python project CI Test (multi-tests)](https://github.com/Chisanan232/GitHub-Action_Workflow-Template-Python/actions/workflows/test_python_project_ci_multi-tests.yaml/badge.svg)](https://github.com/Chisanan232/GitHub-Action_Workflow-Template-Python/actions/workflows/test_python_project_ci_multi-tests.yaml) -[![Python project with Poetry CI Test (multi-tests)](https://github.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/actions/workflows/test_pyproject_ci_multi-tests_by_poetry.yaml/badge.svg)](https://github.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/actions/workflows/test_pyproject_ci_multi-tests_by_poetry.yaml) -[![GitHub Action reusable workflow project CI Test](https://github.com/Chisanan232/GitHub-Action_Workflow-Template-Python/actions/workflows/test_gh_reusable_workflow.yaml/badge.svg)](https://github.com/Chisanan232/GitHub-Action_Workflow-Template-Python/actions/workflows/test_gh_reusable_workflow.yaml) +[![GitHub Action reusable workflow build](https://github.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/actions/workflows/ci-cd.yaml/badge.svg)](https://github.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/actions/workflows/ci-cd.yaml) + +🤖 Test state: + +| Usage scenario / state | +|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| [![Python project CI Test (one-test)](https://github.com/Chisanan232/GitHub-Action_Workflow-Template-Python/actions/workflows/test_python_project_ci_one-test.yaml/badge.svg)](https://github.com/Chisanan232/GitHub-Action_Workflow-Template-Python/actions/workflows/test_python_project_ci_one-test.yaml) | +| [![Python project CI Test (multi-tests)](https://github.com/Chisanan232/GitHub-Action_Workflow-Template-Python/actions/workflows/test_python_project_ci_multi-tests.yaml/badge.svg)](https://github.com/Chisanan232/GitHub-Action_Workflow-Template-Python/actions/workflows/test_python_project_ci_multi-tests.yaml) | +| [![Python project with Poetry CI Test (multi-tests)](https://github.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/actions/workflows/test_pyproject_ci_multi-tests_by_poetry.yaml/badge.svg)](https://github.com/Chisanan232/GitHub-Action_Reusable_Workflows-Python/actions/workflows/test_pyproject_ci_multi-tests_by_poetry.yaml) | +| [![GitHub Action reusable workflow project CI Test](https://github.com/Chisanan232/GitHub-Action_Workflow-Template-Python/actions/workflows/test_gh_reusable_workflow.yaml/badge.svg)](https://github.com/Chisanan232/GitHub-Action_Workflow-Template-Python/actions/workflows/test_gh_reusable_workflow.yaml) | This is a GitHub Action workflow template for **_Python library_** project. From 4e55bc386d8f52b9c795596b119c21c69a19ba31 Mon Sep 17 00:00:00 2001 From: Chisanan232 Date: Tue, 31 Oct 2023 08:32:11 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E2=9E=95=20Add=20mechanism=20about=20keepi?= =?UTF-8?q?ng=20release=20process=20if=20environment=20variable=20=20is=20?= =?UTF-8?q?*TRUE*.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/ci/build_git-tag_or_create_github-release.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ci/build_git-tag_or_create_github-release.sh b/scripts/ci/build_git-tag_or_create_github-release.sh index 88805a0d..aff787f1 100644 --- a/scripts/ci/build_git-tag_or_create_github-release.sh +++ b/scripts/ci/build_git-tag_or_create_github-release.sh @@ -37,7 +37,7 @@ fi Input_Arg_Release_Type=$1 Input_Arg_Debug_Mode=$2 -keep_release=(echo "$KEEP_RELEASE_IF_PRE_VERSION") +keep_release="$KEEP_RELEASE_IF_PRE_VERSION" if [ "$Input_Arg_Release_Type" == "" ]; then echo "❌ The argument 'Input_Arg_Release_Type' (first argument) cannot be empty." @@ -280,7 +280,7 @@ tag_and_release_python_project() { echo "🔎 🐍 📦 Python package new release version: $New_Release_Version" is_pre_release_version=$(echo $New_Release_Version | grep -E -o '([\.-]*([a-zA-Z]{1,})+([0-9]{0,})*){1,}') echo "🔎 🤰 📦 is pre-release version: $is_pre_release_version" - if [ "$is_pre_release_version" == "" ]; then + if [ "$is_pre_release_version" == "" ] || [ "$keep_release" == "TRUE" ]; then echo "🎓 🐍 📦 The version is a official-release." # do different things with different ranches # git event: push