diff options
| author | TiejunZhou <[email protected]> | 2023-11-23 13:17:52 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-11-23 13:17:52 +0800 |
| commit | 11a7db22b4626a4afd183891b2a8f4fa60a137b4 (patch) | |
| tree | 73edd582b2f7f26ed8484696e2bded0cc057e83b /.github/workflows | |
| parent | d17d7bdcbded725e729e324a3cb6b64077553151 (diff) | |
Convert ADO pipelines to GitHub actions (#321)
* Convert ADO pipelines to GitHub actions
* Remove version in uses as not valid for local workflows
* Fix cmake path and add deploy url affix
* Add SMP build job
* Fix code coverage URL
* Add affix to titles of steps
* Remove ADO pipelines
* Add affix to titles of code coverage
* separate PR results for multiple jobs
* Revert "separate PR results for multiple jobs"
This reverts commit 6da13540fd460b6571c6bfe0196abe52e4b1cccf.
* separate PR results for multiple jobs
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/regression_template.yml | 137 | ||||
| -rw-r--r-- | .github/workflows/regression_test.yml | 29 |
2 files changed, 166 insertions, 0 deletions
diff --git a/.github/workflows/regression_template.yml b/.github/workflows/regression_template.yml new file mode 100644 index 00000000..09bf12ad --- /dev/null +++ b/.github/workflows/regression_template.yml @@ -0,0 +1,137 @@ +# This is a basic workflow that is manually triggered + +name: regression_template + +on: + workflow_call: + inputs: + install_script: + default: './scripts/install.sh' + required: false + type: string + build_script: + default: './scripts/build.sh' + required: false + type: string + test_script: + default: './scripts/test.sh' + required: false + type: string + cmake_path: + default: './test/cmake' + required: false + type: string + deploy_url_affix: + default: '' + required: false + type: string + result_affix: + default: '' + required: false + type: string + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "linux_job" + run_tests: + permissions: + contents: read + issues: read + checks: write + pull-requests: write + + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + - name: Check out the repository + uses: actions/checkout@v4 + with: + submodules: true + + - name: Install softwares + run: ${{ inputs.install_script }} + + - name: Build + run: ${{ inputs.build_script }} + + - name: Test + run: ${{ inputs.test_script }} + + - name: Publish Test Results + uses: EnricoMi/[email protected] + if: always() + with: + check_name: Test Results ${{ inputs.result_affix }} + files: | + ${{ inputs.cmake_path }}/build/*/*.xml + + - name: Upload Test Results + if: success() || failure() + uses: actions/[email protected] + with: + name: test_reports + path: | + ${{ inputs.cmake_path }}/build/*.txt + ${{ inputs.cmake_path }}/build/*/Testing/**/*.xml + + - name: Configure GitHub Pages + uses: actions/[email protected] + + - name: Upload GitHub Pages artifact + uses: actions/[email protected] + with: + path: ${{ inputs.cmake_path }}/coverage_report/default_build_coverage + + - name: Generate Code Coverage Results Summary + uses: irongut/[email protected] + with: + filename: ${{ inputs.cmake_path }}/coverage_report/default_build_coverage.xml + format: markdown + badge: true + hide_complexity: true + output: file + + - name: Write Code Coverage Summary + run: | + echo "## Coverage Report ${{ inputs.result_affix }}" >> $GITHUB_STEP_SUMMARY + cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY + + - name: Create CheckRun for Code Coverage + if: (github.event_name == 'push') || (github.event.pull_request.head.repo.full_name == github.repository) + uses: LouisBrunner/[email protected] + with: + token: ${{ secrets.GITHUB_TOKEN }} + name: Code Coverage ${{ inputs.result_affix }} + conclusion: ${{ job.status }} + output: | + {"summary":"Coverage Report"} + output_text_description_file: code-coverage-results.md + + - name: Add Code Coverage PR Comment + if: (github.event_name == 'push') || (github.event.pull_request.head.repo.full_name == github.repository) + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: Code Coverage ${{ inputs.result_affix }} + path: code-coverage-results.md + + deploy_code_coverage: + runs-on: ubuntu-latest + if: github.event_name == 'push' + needs: run_tests + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }}${{ inputs.deploy_url_affix }} + permissions: + pages: write + id-token: write + + steps: + - name: Deploy GitHub Pages site + id: deployment + uses: actions/[email protected] + + - name: Write Code Coverage Report URL + run: | + echo '[Open Coverage Report](${{ steps.deployment.outputs.page_url }}${{ inputs.deploy_url_affix }})' >> $GITHUB_STEP_SUMMARY
\ No newline at end of file diff --git a/.github/workflows/regression_test.yml b/.github/workflows/regression_test.yml new file mode 100644 index 00000000..3da63221 --- /dev/null +++ b/.github/workflows/regression_test.yml @@ -0,0 +1,29 @@ +name: regression_test + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + workflow_dispatch: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + tx: + uses: ./.github/workflows/regression_template.yml + with: + build_script: ./scripts/build_tx.sh + test_script: ./scripts/test_tx.sh + cmake_path: ./test/tx/cmake + deploy_url_affix: tx/ + result_affix: ThreadX + tx_smp: + uses: ./.github/workflows/regression_template.yml + with: + build_script: ./scripts/build_smp.sh + test_script: ./scripts/test_smp.sh + cmake_path: ./test/smp/cmake + deploy_url_affix: smp/ + result_affix: SMP
\ No newline at end of file |
