Skip to content

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

⬆ 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 #381

name: Python project CI Test (one-test)
on:
push:
branches:
- "master"
paths:
# The workflow self.
- ".github/workflows/test_python_project_ci_one-test.yaml"
# The shell script only be used by this workflow.
- "scripts/ci/check_getting_output.sh"
# The sample Python code.
- ".coveragerc"
- "pytest.ini"
- "sonar-project.properties"
- "requirements/**"
- "setup.py"
- "test_gh_workflow/**"
- "test/**"
# The shell scripts or actions this workflow would use.
- ".github/workflows/rw_get_tests.yaml"
- ".github/workflows/rw_run_test.yaml"
- ".github/workflows/rw_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_python_project_ci_one-test.yaml"
# The shell script only be used by this workflow.
- "scripts/ci/check_getting_output.sh"
# The sample Python code.
- ".coveragerc"
- "pytest.ini"
- "sonar-project.properties"
- "requirements/**"
- "setup.py"
- "test_gh_workflow/**"
- "test/**"
# The shell scripts or actions this workflow would use.
- ".github/workflows/rw_get_tests.yaml"
- ".github/workflows/rw_run_test.yaml"
- ".github/workflows/rw_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/
run_unit-test:
# name: Run all unit test items
needs: prep-testbed_unit-test
uses: ./.github/workflows/rw_run_test_with_multi_py_versions.yaml
with:
test_type: unit-test
all_test_items_paths: ${{needs.prep-testbed_unit-test.outputs.all_test_items}}
unit-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
uses: ./.github/workflows/rw_organize_test_cov_reports.yaml
with:
test_type: unit-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: [unit-test_codecov]
uses: ./.github/workflows/rw_upload_test_cov_report.yaml
secrets:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
with:
test_type: unit-test
upload-to-codecov: true
codecov_flags: unit # 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: [unit-test_codecov]
uses: ./.github/workflows/rw_upload_test_cov_report.yaml
secrets:
coveralls_token: ${{ secrets.COVERALLS_TOKEN }}
with:
test_type: unit-test
upload-to-coveralls: true
codacy_finish:
# name: Upload test report to Codacy to analyse and record code quality
needs: [unit-test_codecov]
uses: ./.github/workflows/rw_upload_test_cov_report.yaml
secrets:
codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }}
with:
test_type: unit-test
upload-to-codacy: true
sonarqube_finish:
# name: Trigger SoarQube service to scan and analyse project
needs: [unit-test_codecov]
uses: ./.github/workflows/rw_sonarqube_scan.yaml
secrets:
sonar_token: ${{ secrets.SONAR_TOKEN }}
with:
test_type: unit-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
needs: [codecov_finish, coveralls_finish, codacy_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
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
push_python_pkg_to_pypi:
# 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/rw_push_pypi.yaml
with:
release-type: ${{ needs.build_git-tag_and_create_github-release.outputs.python_release_version }}
push-to-PyPI: test
secrets:
pypi_user: ${{ secrets.PYPI_USERNAME }}
pypi_token: ${{ secrets.PYPI_PASSWORD }}