|
| 1 | +name: github-action reusable workflows test |
| 2 | +on: |
| 3 | + push: |
| 4 | + branches: |
| 5 | + - "develop" |
| 6 | + - "release" |
| 7 | + - "release-**" |
| 8 | + - "release/**" |
| 9 | + - "master" |
| 10 | + paths-ignore: |
| 11 | + - ".gitcommitrules" |
| 12 | + - ".gitignore" |
| 13 | + - "LICENSE" |
| 14 | + - "README.md" |
| 15 | + pull_request: |
| 16 | + branches: |
| 17 | + - "develop" |
| 18 | + - "release" |
| 19 | + - "release-**" |
| 20 | + - "release/**" |
| 21 | + paths-ignore: |
| 22 | + - ".gitcommitrules" |
| 23 | + - ".gitignore" |
| 24 | + - "LICENSE" |
| 25 | + - "README.md" |
| 26 | + |
| 27 | +jobs: |
| 28 | + |
| 29 | + prep-testbed_unit-test: |
| 30 | +# name: Prepare all unit test items |
| 31 | + uses: ./.github/workflows/prepare_test_items.yaml |
| 32 | + with: |
| 33 | + shell_path: scripts/ci/get-unit-test-paths.sh |
| 34 | + shell_arg: unix |
| 35 | + |
| 36 | + |
| 37 | + prep-testbed_integration-test: |
| 38 | +# name: Prepare all integration test items |
| 39 | + uses: ./.github/workflows/prepare_test_items.yaml |
| 40 | + with: |
| 41 | + shell_path: scripts/ci/get-integration-test-paths.sh |
| 42 | + shell_arg: unix |
| 43 | + |
| 44 | + |
| 45 | + run_unit-test: |
| 46 | +# name: Run all unit test items |
| 47 | + needs: prep-testbed_unit-test |
| 48 | + uses: ./.github/workflows/run_test_items_via_pytest.yaml |
| 49 | + with: |
| 50 | + test_type: unit-test |
| 51 | + all_test_items_paths: ${{needs.prep-testbed_unit-test.outputs.all_test_items}} |
| 52 | + |
| 53 | + |
| 54 | + run_integration-test: |
| 55 | +# name: Run all integration test items. This testing would test the code with other resource or system to ensure the features work finely. |
| 56 | + needs: prep-testbed_integration-test |
| 57 | + uses: ./.github/workflows/run_test_items_via_pytest.yaml |
| 58 | + with: |
| 59 | + test_type: integration-test |
| 60 | + all_test_items_paths: ${{needs.prep-testbed_integration-test.outputs.all_test_items}} |
| 61 | + |
| 62 | + |
| 63 | + unit-test_codecov: |
| 64 | +# name: Organize and generate the testing report and upload it to Codecov |
| 65 | + needs: run_unit-test |
| 66 | + uses: ./.github/workflows/organize_all_testing_coverage_reports_with_different_os_and_py_version.yaml |
| 67 | + with: |
| 68 | + test_type: unit-test |
| 69 | + generate_xml_report_finally: false |
| 70 | + |
| 71 | + |
| 72 | + integration-test_codecov: |
| 73 | +# name: Organize and generate the testing report and upload it to Codecov |
| 74 | + needs: run_integration-test |
| 75 | + uses: ./.github/workflows/organize_all_testing_coverage_reports_with_different_os_and_py_version.yaml |
| 76 | + with: |
| 77 | + test_type: integration-test |
| 78 | + generate_xml_report_finally: false |
| 79 | + |
| 80 | + |
| 81 | + organize_all-test_codecov_and_generate_report: |
| 82 | +# name: Organize and generate the testing report and upload it to Codecov |
| 83 | + needs: [unit-test_codecov, integration-test_codecov] |
| 84 | + uses: ./.github/workflows/organize_all_testing_reports_with_different_test_type.yaml |
| 85 | + |
| 86 | + |
| 87 | + codecov_finish: |
| 88 | +# name: Organize and generate the testing report and upload it to Codecov |
| 89 | + if: github.ref_name == 'release' || github.ref_name == 'master' |
| 90 | + needs: organize_all-test_codecov_and_generate_report |
| 91 | + uses: ./.github/workflows/upload_test_report_to_codecov.yaml |
| 92 | + secrets: |
| 93 | + codecov_token: ${{ secrets.CODECOV_TOKEN }} |
| 94 | + with: |
| 95 | + download_path: ./ |
| 96 | + codecov_flags: unit-test, integration-test |
| 97 | + codecov_name: smoothcrawler-appintegration_github-actions_test # optional |
| 98 | + |
| 99 | + |
| 100 | + codacy_finish: |
| 101 | +# name: Upload test report to Codacy to analyse and record code quality |
| 102 | + needs: [codecov_finish] |
| 103 | + uses: ./.github/workflows/upload_code_report_to_codacy.yaml |
| 104 | + secrets: |
| 105 | + codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }} |
| 106 | + with: |
| 107 | + download_path: ./ |
| 108 | + |
| 109 | + |
| 110 | +# pre-building_check: |
| 111 | +## name: Check about it could work finely by installing the Python package with setup.py file |
| 112 | +# needs: [codecov_finish, codacy_finish] |
| 113 | +# uses: Chisanan232/GitHub-Action-Template-Python/.github/workflows/upload_code_report_to_codacy.yaml |
| 114 | +# with: |
| 115 | +# python_package_name: smoothcrawler |
| 116 | +# test_import_package_code_1: import smoothcrawler as mr |
| 117 | +# test_import_package_code_2: from smoothcrawler.crawler import SimpleCrawler |
| 118 | +# test_import_package_code_3: from smoothcrawler.components.data import BaseHTTPResponseParser, BaseDataHandler |
| 119 | +# test_python_script: ./scripts/test_crawler.py |
| 120 | + |
0 commit comments