diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index 37b92682..3299d141 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -23,10 +23,10 @@ on: - "README.md" jobs: - test_build_git-tag_and_create_github-release: + build_git-tag_and_create_github-release: # name: Build git tag and GitHub release if it needs if: ${{ github.ref_name == 'master' && github.event_name == 'push' }} - uses: ./.github/workflows/build_git-tag_and_create_github-release.yaml + uses: ./.github/workflows/rw_build_git-tag_and_create_github-release.yaml secrets: github_auth_token: ${{ secrets.GITHUB_TOKEN }} with: @@ -34,9 +34,9 @@ jobs: debug_mode: false - test_deploy_as_new_branch: + deploy_as_new_branch: # name: Create new git branch by the tagged commit - needs: test_build_git-tag_and_create_github-release + needs: build_git-tag_and_create_github-release if: ${{ github.ref_name == 'master' && github.event_name == 'push' && needs.test_build_git-tag_and_create_github-release.outputs.github-action_reusable_workflow_release_version != 'Pre-Release' }} diff --git a/.github/workflows/build_git-tag_and_create_github-release.yaml b/.github/workflows/rw_build_git-tag_and_create_github-release.yaml similarity index 100% rename from .github/workflows/build_git-tag_and_create_github-release.yaml rename to .github/workflows/rw_build_git-tag_and_create_github-release.yaml diff --git a/.github/workflows/prepare_test_items.yaml b/.github/workflows/rw_get_tests.yaml similarity index 100% rename from .github/workflows/prepare_test_items.yaml rename to .github/workflows/rw_get_tests.yaml diff --git a/.github/workflows/organize_and_generate_test_cov_reports.yaml b/.github/workflows/rw_organize_test_cov_reports.yaml similarity index 100% rename from .github/workflows/organize_and_generate_test_cov_reports.yaml rename to .github/workflows/rw_organize_test_cov_reports.yaml diff --git a/.github/workflows/poetry_run_test_via_pytest.yaml b/.github/workflows/rw_poetry_run_test.yaml similarity index 100% rename from .github/workflows/poetry_run_test_via_pytest.yaml rename to .github/workflows/rw_poetry_run_test.yaml diff --git a/.github/workflows/pre-building_test.yaml b/.github/workflows/rw_pre-building_test.yaml similarity index 100% rename from .github/workflows/pre-building_test.yaml rename to .github/workflows/rw_pre-building_test.yaml diff --git a/.github/workflows/push_pkg_to_pypi.yaml b/.github/workflows/rw_push_pypi.yaml similarity index 100% rename from .github/workflows/push_pkg_to_pypi.yaml rename to .github/workflows/rw_push_pypi.yaml diff --git a/.github/workflows/run_test_items_via_pytest.yaml b/.github/workflows/rw_run_test.yaml similarity index 100% rename from .github/workflows/run_test_items_via_pytest.yaml rename to .github/workflows/rw_run_test.yaml diff --git a/.github/workflows/sonarqube_scan.yaml b/.github/workflows/rw_sonarqube_scan.yaml similarity index 100% rename from .github/workflows/sonarqube_scan.yaml rename to .github/workflows/rw_sonarqube_scan.yaml diff --git a/.github/workflows/upload_test_cov_report.yaml b/.github/workflows/rw_upload_test_cov_report.yaml similarity index 100% rename from .github/workflows/upload_test_cov_report.yaml rename to .github/workflows/rw_upload_test_cov_report.yaml diff --git a/.github/workflows/test_gh_reusable_workflow.yaml b/.github/workflows/test_gh_reusable_workflow.yaml index 6cf75b50..aad9147e 100644 --- a/.github/workflows/test_gh_reusable_workflow.yaml +++ b/.github/workflows/test_gh_reusable_workflow.yaml @@ -30,7 +30,7 @@ on: jobs: test_build_git-tag_and_create_github-release: # name: Build git tag and GitHub release if it needs - uses: ./.github/workflows/build_git-tag_and_create_github-release.yaml + uses: ./.github/workflows/rw_build_git-tag_and_create_github-release.yaml secrets: github_auth_token: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/.github/workflows/test_pyproject_ci_multi-tests_by_poetry.yaml b/.github/workflows/test_pyproject_ci_multi-tests_by_poetry.yaml index ff955710..ca973112 100644 --- a/.github/workflows/test_pyproject_ci_multi-tests_by_poetry.yaml +++ b/.github/workflows/test_pyproject_ci_multi-tests_by_poetry.yaml @@ -30,14 +30,14 @@ on: jobs: prep-testbed_unit-test: # name: Prepare all unit test items - uses: ./.github/workflows/prepare_test_items.yaml + uses: ./.github/workflows/rw_get_tests.yaml with: shell_arg: test/unit_test/ prep-testbed_integration-test: # name: Prepare all integration test items - uses: ./.github/workflows/prepare_test_items.yaml + uses: ./.github/workflows/rw_get_tests.yaml with: shell_path: scripts/ci/test/get-integration-test-paths.sh shell_arg: unix @@ -47,7 +47,7 @@ jobs: run_unit-test: # name: Run all unit test items needs: prep-testbed_unit-test - uses: ./.github/workflows/poetry_run_test_via_pytest.yaml + uses: ./.github/workflows/rw_poetry_run_test.yaml with: test_type: unit-test all_test_items_paths: ${{needs.prep-testbed_unit-test.outputs.all_test_items}} @@ -56,7 +56,7 @@ jobs: run_integration-test: # name: Run all integration test items. This testing would test the code with other resource or system to ensure the features work finely. needs: prep-testbed_integration-test - uses: ./.github/workflows/poetry_run_test_via_pytest.yaml + uses: ./.github/workflows/rw_poetry_run_test.yaml with: test_type: integration-test all_test_items_paths: ${{needs.prep-testbed_integration-test.outputs.all_test_items}} @@ -70,7 +70,7 @@ jobs: all-test_codecov: # name: Organize and generate the testing report and upload it to Codecov needs: [run_unit-test, run_integration-test] - uses: ./.github/workflows/organize_and_generate_test_cov_reports.yaml + uses: ./.github/workflows/rw_organize_test_cov_reports.yaml with: test_type: all-test @@ -79,7 +79,7 @@ jobs: # name: Organize and generate the testing report and upload it to Codecov # if: github.ref_name == 'release' || github.ref_name == 'master' needs: [all-test_codecov] - uses: ./.github/workflows/upload_test_cov_report.yaml + uses: ./.github/workflows/rw_upload_test_cov_report.yaml secrets: codecov_token: ${{ secrets.CODECOV_TOKEN }} with: @@ -93,7 +93,7 @@ jobs: # name: Organize and generate the testing report and upload it to Coveralls # if: github.ref_name == 'release' || github.ref_name == 'master' needs: [all-test_codecov] - uses: ./.github/workflows/upload_test_cov_report.yaml + uses: ./.github/workflows/rw_upload_test_cov_report.yaml secrets: coveralls_token: ${{ secrets.COVERALLS_TOKEN }} with: @@ -104,7 +104,7 @@ jobs: codacy_finish: # name: Upload test report to Codacy to analyse and record code quality needs: [all-test_codecov] - uses: ./.github/workflows/upload_test_cov_report.yaml + uses: ./.github/workflows/rw_upload_test_cov_report.yaml secrets: codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }} with: @@ -115,7 +115,7 @@ jobs: sonarqube_finish: # name: Trigger SoarQube service to scan and analyse project needs: [all-test_codecov] - uses: ./.github/workflows/sonarqube_scan.yaml + uses: ./.github/workflows/rw_sonarqube_scan.yaml secrets: sonar_token: ${{ secrets.SONAR_TOKEN }} # with: @@ -127,7 +127,7 @@ jobs: # if: github.event_name == 'push' && (github.ref_name == 'release' || github.ref_name == 'master') if: github.event_name == 'push' needs: [codecov_finish, coveralls_finish, codacy_finish] - uses: ./.github/workflows/pre-building_test.yaml + uses: ./.github/workflows/rw_pre-building_test.yaml with: build-type: poetry python_package_name: Test-GitHub-Action-workflow @@ -138,7 +138,7 @@ jobs: build_git-tag_and_create_github-release: # name: Build git tag and GitHub release if it needs needs: pre-building_test - uses: ./.github/workflows/build_git-tag_and_create_github-release.yaml + uses: ./.github/workflows/rw_build_git-tag_and_create_github-release.yaml with: project_type: python-package project_name: test_gh_workflow diff --git a/.github/workflows/test_python_project_ci_multi-tests.yaml b/.github/workflows/test_python_project_ci_multi-tests.yaml index f79cec95..f5efbecc 100644 --- a/.github/workflows/test_python_project_ci_multi-tests.yaml +++ b/.github/workflows/test_python_project_ci_multi-tests.yaml @@ -32,14 +32,14 @@ on: jobs: prep-testbed_unit-test: # name: Prepare all unit test items - uses: ./.github/workflows/prepare_test_items.yaml + uses: ./.github/workflows/rw_get_tests.yaml with: shell_arg: test/unit_test/ prep-testbed_integration-test: # name: Prepare all integration test items - uses: ./.github/workflows/prepare_test_items.yaml + uses: ./.github/workflows/rw_get_tests.yaml with: shell_path: scripts/ci/test/get-integration-test-paths.sh shell_arg: unix @@ -49,7 +49,7 @@ jobs: run_unit-test: # name: Run all unit test items needs: prep-testbed_unit-test - uses: ./.github/workflows/run_test_items_via_pytest.yaml + uses: ./.github/workflows/rw_run_test.yaml with: test_type: unit-test all_test_items_paths: ${{needs.prep-testbed_unit-test.outputs.all_test_items}} @@ -59,7 +59,7 @@ jobs: run_integration-test: # name: Run all integration test items. This testing would test the code with other resource or system to ensure the features work finely. needs: prep-testbed_integration-test - uses: ./.github/workflows/run_test_items_via_pytest.yaml + uses: ./.github/workflows/rw_run_test.yaml with: test_type: integration-test all_test_items_paths: ${{needs.prep-testbed_integration-test.outputs.all_test_items}} @@ -74,7 +74,7 @@ jobs: all-test_codecov: # name: Organize and generate the testing report and upload it to Codecov needs: [run_unit-test, run_integration-test] - uses: ./.github/workflows/organize_and_generate_test_cov_reports.yaml + uses: ./.github/workflows/rw_organize_test_cov_reports.yaml with: test_type: all-test @@ -83,7 +83,7 @@ jobs: # name: Organize and generate the testing report and upload it to Codecov # if: github.ref_name == 'release' || github.ref_name == 'master' needs: [all-test_codecov] - uses: ./.github/workflows/upload_test_cov_report.yaml + uses: ./.github/workflows/rw_upload_test_cov_report.yaml secrets: codecov_token: ${{ secrets.CODECOV_TOKEN }} with: @@ -97,7 +97,7 @@ jobs: # name: Organize and generate the testing report and upload it to Coveralls # if: github.ref_name == 'release' || github.ref_name == 'master' needs: [all-test_codecov] - uses: ./.github/workflows/upload_test_cov_report.yaml + uses: ./.github/workflows/rw_upload_test_cov_report.yaml secrets: coveralls_token: ${{ secrets.COVERALLS_TOKEN }} with: @@ -108,7 +108,7 @@ jobs: codacy_finish: # name: Upload test report to Codacy to analyse and record code quality needs: [all-test_codecov] - uses: ./.github/workflows/upload_test_cov_report.yaml + uses: ./.github/workflows/rw_upload_test_cov_report.yaml secrets: codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }} with: @@ -116,11 +116,21 @@ jobs: upload-to-codacy: true + sonarqube_finish: +# name: Trigger SoarQube service to scan and analyse project + needs: [all-test_codecov] + uses: ./.github/workflows/rw_sonarqube_scan.yaml + secrets: + sonar_token: ${{ secrets.SONAR_TOKEN }} +# with: +# download_path: ${{ inputs.download_path }} + + pre-building_test: # name: Check about it could work finely by installing the Python package with setup.py file if: github.event_name == 'push' && (github.ref_name == 'release' || github.ref_name == 'master') - needs: [codecov_finish, coveralls_finish, codacy_finish] - uses: ./.github/workflows/pre-building_test.yaml + needs: [codecov_finish, coveralls_finish, codacy_finish, sonarqube_finish] + uses: ./.github/workflows/rw_pre-building_test.yaml with: python_package_name: Test-GitHub-Action-workflow test_shell_in_python: from test_gh_workflow import sample @@ -130,7 +140,7 @@ jobs: build_git-tag_and_create_github-release: # name: Build git tag and GitHub release if it needs needs: pre-building_test - uses: ./.github/workflows/build_git-tag_and_create_github-release.yaml + uses: ./.github/workflows/rw_build_git-tag_and_create_github-release.yaml with: project_type: python-package project_name: test_gh_workflow diff --git a/.github/workflows/test_python_project_ci_one-test.yaml b/.github/workflows/test_python_project_ci_one-test.yaml index 625f58fb..0b4907b7 100644 --- a/.github/workflows/test_python_project_ci_one-test.yaml +++ b/.github/workflows/test_python_project_ci_one-test.yaml @@ -31,7 +31,7 @@ on: jobs: prep-testbed_unit-test: # name: Prepare all unit test items - uses: ./.github/workflows/prepare_test_items.yaml + uses: ./.github/workflows/rw_get_tests.yaml with: shell_arg: test/unit_test/ @@ -39,7 +39,7 @@ jobs: run_unit-test: # name: Run all unit test items needs: prep-testbed_unit-test - uses: ./.github/workflows/run_test_items_via_pytest.yaml + uses: ./.github/workflows/rw_run_test.yaml with: test_type: unit-test all_test_items_paths: ${{needs.prep-testbed_unit-test.outputs.all_test_items}} @@ -49,7 +49,7 @@ jobs: unit-test_codecov: # name: Organize and generate the testing report and upload it to Codecov needs: run_unit-test - uses: ./.github/workflows/organize_and_generate_test_cov_reports.yaml + uses: ./.github/workflows/rw_organize_test_cov_reports.yaml with: test_type: unit-test @@ -58,7 +58,7 @@ jobs: # name: Organize and generate the testing report and upload it to Codecov # if: github.ref_name == 'release' || github.ref_name == 'master' needs: [unit-test_codecov] - uses: ./.github/workflows/upload_test_cov_report.yaml + uses: ./.github/workflows/rw_upload_test_cov_report.yaml secrets: codecov_token: ${{ secrets.CODECOV_TOKEN }} with: @@ -72,7 +72,7 @@ jobs: # name: Organize and generate the testing report and upload it to Coveralls # if: github.ref_name == 'release' || github.ref_name == 'master' needs: [unit-test_codecov] - uses: ./.github/workflows/upload_test_cov_report.yaml + uses: ./.github/workflows/rw_upload_test_cov_report.yaml secrets: coveralls_token: ${{ secrets.COVERALLS_TOKEN }} with: @@ -83,7 +83,7 @@ jobs: codacy_finish: # name: Upload test report to Codacy to analyse and record code quality needs: [unit-test_codecov] - uses: ./.github/workflows/upload_test_cov_report.yaml + uses: ./.github/workflows/rw_upload_test_cov_report.yaml secrets: codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }} with: @@ -94,7 +94,7 @@ jobs: sonarqube_finish: # name: Trigger SoarQube service to scan and analyse project needs: [unit-test_codecov] - uses: ./.github/workflows/sonarqube_scan.yaml + uses: ./.github/workflows/rw_sonarqube_scan.yaml secrets: sonar_token: ${{ secrets.SONAR_TOKEN }} # with: @@ -104,7 +104,7 @@ jobs: pre-building_test: # name: Check about it could work finely by installing the Python package with setup.py file needs: [codecov_finish, coveralls_finish, codacy_finish] - uses: ./.github/workflows/pre-building_test.yaml + uses: ./.github/workflows/rw_pre-building_test.yaml with: python_package_name: Test-GitHub-Action-workflow test_shell_in_python: from test_gh_workflow import sample @@ -114,7 +114,7 @@ jobs: build_git-tag_and_create_github-release: # name: Build git tag and GitHub release if it needs needs: pre-building_test - uses: ./.github/workflows/build_git-tag_and_create_github-release.yaml + uses: ./.github/workflows/rw_build_git-tag_and_create_github-release.yaml with: project_type: python-package project_name: test_gh_workflow @@ -126,7 +126,7 @@ jobs: # name: Upload the Python package files which has been compiled to PyPi if: github.event_name == 'push' && github.ref_name == 'release' needs: build_git-tag_and_create_github-release - uses: ./.github/workflows/push_pkg_to_pypi.yaml + uses: ./.github/workflows/rw_push_pypi.yaml with: release-type: ${{ needs.build_git-tag_and_create_github-release.outputs.python_release_version }} push-to-PyPI: test diff --git a/README.md b/README.md index c51caa97..76080abf 100644 --- a/README.md +++ b/README.md @@ -26,18 +26,18 @@ this project. This project has some workflow templates for reusing in GitHub Act The usage of each workflow template. -* [_prepare_test_items.yaml_](#prepare_test_itemsyaml) -* [_run_test_items_via_pytest.yaml_](#run_test_items_via_pytestyaml) -* [_organize_and_generate_test_cov_reports.yaml_](#organize_and_generate_test_cov_reportsyaml) -* [_upload_test_cov_report.yaml_](#upload_test_cov_reportyaml) -* [_pre-building_test.yaml_](#pre-building_testyaml) -* [_build_git-tag_and_create_github-release.yaml_](#build_git-tag_and_create_github-releaseyaml) -* [_push_pkg_to_pypi.yaml_](#push_pkg_to_pypiyaml) +* [_rw_get_tests.yaml_](#rw_get_testsyaml) +* [_rw_run_test.yaml_](#rw_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) +* [_rw_build_git-tag_and_create_github-release.yaml_](#rw_build_git-tag_and_create_github-releaseyaml) +* [_rw_push_pypi.yaml_](#rw_push_pypiyaml)