Skip to content

⬆ Bump SonarSource/sonarqube-scan-action from 6.0.0 to 7.0.0 #292

⬆ Bump SonarSource/sonarqube-scan-action from 6.0.0 to 7.0.0

⬆ Bump SonarSource/sonarqube-scan-action from 6.0.0 to 7.0.0 #292

name: Python project with Poetry CI Test (multi-tests)
on:
push:
branches:
- "master"
paths:
# The workflow self.
- ".github/workflows/test_pyproject_ci_multi-tests_by_poetry.yaml"
# The shell script only be used by this workflow.
- "scripts/ci/check_getting_output.sh"
# The sample Python code.
- ".coveragerc"
- "pyproject.toml"
- "poetry.lock"
- "pytest.ini"
- "sonar-project.properties"
- "test_gh_workflow/**"
- "test/**"
# The shell scripts or actions this workflow would use.
- ".github/workflows/rw_get_tests.yaml"
- ".github/workflows/rw_poetry_run_test.yaml"
- ".github/workflows/rw_poetry_run_test_with_multi_py_versions.yaml"
- ".github/workflows/rw_organize_test_cov_reports.yaml"
- "scripts/ci/combine_coverage_reports.sh"
- ".github/workflows/rw_upload_test_cov_report.yaml"
- "scripts/ci/check-input-params.sh"
- ".github/workflows/rw_sonarqube_scan.yaml"
- ".github/workflows/rw_pre-building_test.yaml"
- ".github/workflows/rw_build_git-tag_and_create_github-release.yaml"
- "scripts/ci/build_git-tag_or_create_github-release.sh"
- "scripts/ci/deployment_new_version_workflow.sh"
pull_request:
branches:
- "master"
paths:
# The workflow self.
- ".github/workflows/test_pyproject_ci_multi-tests_by_poetry.yaml"
# The shell script only be used by this workflow.
- "scripts/ci/check_getting_output.sh"
# The sample Python code.
- ".coveragerc"
- "pyproject.toml"
- "poetry.lock"
- "pytest.ini"
- "sonar-project.properties"
- "test_gh_workflow/**"
- "test/**"
# The shell scripts or actions this workflow would use.
- ".github/workflows/rw_get_tests.yaml"
- ".github/workflows/rw_poetry_run_test.yaml"
- ".github/workflows/rw_poetry_run_test_with_multi_py_versions.yaml"
- ".github/workflows/rw_organize_test_cov_reports.yaml"
- "scripts/ci/combine_coverage_reports.sh"
- ".github/workflows/rw_upload_test_cov_report.yaml"
- "scripts/ci/check-input-params.sh"
- ".github/workflows/rw_sonarqube_scan.yaml"
- ".github/workflows/rw_pre-building_test.yaml"
- ".github/workflows/rw_build_git-tag_and_create_github-release.yaml"
- "scripts/ci/build_git-tag_or_create_github-release.sh"
- "scripts/ci/deployment_new_version_workflow.sh"
jobs:
prep-testbed_unit-test:
# name: Prepare all unit test items
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/rw_get_tests.yaml
with:
shell_path: scripts/ci/test/get-integration-test-paths.sh
shell_arg: unix
use_customized_shell: true
run_unit-test:
# name: Run all unit test items
needs: prep-testbed_unit-test
uses: ./.github/workflows/rw_poetry_run_test.yaml
with:
test_type: unit-test
install_dependency_with_group: github-action
all_test_items_paths: ${{needs.prep-testbed_unit-test.outputs.all_test_items}}
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/rw_poetry_run_test_with_multi_py_versions.yaml
with:
test_type: integration-test
install_dependency_with_group: github-action
all_test_items_paths: ${{needs.prep-testbed_integration-test.outputs.all_test_items}}
setup_http_server: true
http_server_host: 0.0.0.0
http_server_port: 30303
http_server_app_module: test._http_server.app
http_server_enter_point: app
all-test_codecov:
# name: Organize and generate the testing report and upload it to Codecov
if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependencies') }}
needs: [run_unit-test, run_integration-test]
uses: ./.github/workflows/rw_organize_test_cov_reports.yaml
with:
test_type: all-test
codecov_finish:
# 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/rw_upload_test_cov_report.yaml
secrets:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
with:
test_type: all-test
upload-to-codecov: true
codecov_flags: unit,integration # Required if 'upload-to-codecov' is true
codecov_name: gh_workflow_template # Required if 'upload-to-codecov' is true
coveralls_finish:
# 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/rw_upload_test_cov_report.yaml
secrets:
coveralls_token: ${{ secrets.COVERALLS_TOKEN }}
with:
test_type: all-test
upload-to-coveralls: true
codacy_finish:
# name: Upload test report to Codacy to analyse and record code quality
needs: [all-test_codecov]
uses: ./.github/workflows/rw_upload_test_cov_report.yaml
secrets:
codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }}
with:
test_type: all-test
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:
test_type: all-test
# 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')
if: github.event_name == 'push'
needs: [codecov_finish, coveralls_finish, codacy_finish]
uses: ./.github/workflows/rw_pre-building_test.yaml
with:
build-type: poetry
python_package_name: Test-GitHub-Action-workflow
test_shell: echo 'Test running'
test_python_script: ./scripts/ci/test/test_pgk_install.py
build_git-tag_and_create_github-release:
# name: Build git tag and GitHub release if it needs
needs: pre-building_test
uses: ./.github/workflows/rw_build_git-tag_and_create_github-release.yaml
with:
project_type: python-package
project_name: test_gh_workflow
software_version_format: general-3
debug_mode: true
fake_build_pkg_and_push_to_pypi:
# name: Check about it could work finely by installing the Python package with setup.py file
needs: build_git-tag_and_create_github-release
if: github.event_name == 'push'
runs-on: ubuntu-latest
env:
RELEASE_TYPE: ${{ needs.build_git-tag_and_create_github-release.outputs.python_release_version }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Check it whether get the output of previous one job which has version info or not
run: bash scripts/ci/check_getting_output.sh
- name: For testing about getting the software version info
run: |
echo "Release version: $RELEASE_TYPE"