1
0
mirror of https://github.com/azure-rtos/threadx synced 2025-01-30 08:02:57 +08:00

Split artifacts for multiple jobs (#324)

* Test multiple code coverage pages

* Add affix to artifacts

* Test uploading code coverage as artifact

* Deploy GitHub pages at last for multiple jobs

* Test using unified upload pages

* Disable test cases to accelerate experiment

* Fix escape character $

* Revert "Test using unified upload pages"

This reverts commit 3668d9f67253651c8cea38e9aba639dff081168d.

* Set destination for downloaded artifact

* Use a different artifact name

* Fix escape value

* Revert "Disable test cases to accelerate experiment"

This reverts commit 8468f17d0298a483692ab613524bc6ab5443a67a.

* Override duplicated github-pages in artifact

* Revert "Override duplicated github-pages in artifact"

This reverts commit 17a83aa97df4233417e20d31d36aa61e976dbebf.

* Delete Duplicate Code Coverage Artifact
This commit is contained in:
TiejunZhou 2023-11-24 13:59:26 +08:00 committed by GitHub
parent 11a7db22b4
commit 5f9c713c48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 71 additions and 17 deletions

View File

@ -21,7 +21,15 @@ on:
default: './test/cmake'
required: false
type: string
deploy_url_affix:
skip_test:
default: false
required: false
type: boolean
skip_deploy:
default: false
required: false
type: boolean
deploy_list:
default: ''
required: false
type: string
@ -34,6 +42,7 @@ on:
jobs:
# This workflow contains a single job called "linux_job"
run_tests:
if: ${{ !inputs.skip_test}}
permissions:
contents: read
issues: read
@ -71,18 +80,14 @@ jobs:
if: success() || failure()
uses: actions/upload-artifact@v3.1.3
with:
name: test_reports
name: test_reports ${{ inputs.result_affix }}
path: |
${{ inputs.cmake_path }}/build/*.txt
${{ inputs.cmake_path }}/build/*/Testing/**/*.xml
${{ inputs.cmake_path }}/build/**/regression/output_files/*.bin
- name: Configure GitHub Pages
uses: actions/configure-pages@v3.0.6
- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@v2.0.0
with:
path: ${{ inputs.cmake_path }}/coverage_report/default_build_coverage
- name: Generate Code Coverage Results Summary
uses: irongut/CodeCoverageSummary@v1.3.0
@ -115,23 +120,66 @@ jobs:
with:
header: Code Coverage ${{ inputs.result_affix }}
path: code-coverage-results.md
- name: Prepare GitHub Pages
run: >-
if [ "${{ inputs.result_affix }}" != "" ]; then
mv ${{ inputs.cmake_path }}/coverage_report/default_build_coverage \
${{ inputs.cmake_path }}/coverage_report/${{ inputs.result_affix }}
fi
- name: Upload Code Coverage Artifacts
uses: actions/upload-artifact@v3.1.3
if: ${{ inputs.skip_deploy }}
with:
name: coverage_report
path: ${{ inputs.cmake_path }}/coverage_report
retention-days: 1
- name: Upload Code Coverage Pages
uses: actions/upload-pages-artifact@v2.0.0
if: ${{ !inputs.skip_deploy }}
with:
path: ${{ inputs.cmake_path }}/coverage_report/default_build_coverage
deploy_code_coverage:
runs-on: ubuntu-latest
if: github.event_name == 'push'
if: ${{ (github.event_name == 'push') && !inputs.skip_deploy && always() }}
needs: run_tests
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}${{ inputs.deploy_url_affix }}
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:
steps:
- uses: actions/download-artifact@v3
if: ${{ inputs.skip_test }}
with:
name: coverage_report
- name: Upload Code Coverage Pages
uses: actions/upload-pages-artifact@v2.0.0
if: ${{ inputs.skip_test }}
with:
path: .
- name: Delete Duplicate Code Coverage Artifact
uses: geekyeggo/delete-artifact@v2
with:
name: coverage_report
- name: Deploy GitHub Pages site
id: deployment
uses: actions/deploy-pages@v1.2.9
- name: Write Code Coverage Report URL
run: |
echo '[Open Coverage Report](${{ steps.deployment.outputs.page_url }}${{ inputs.deploy_url_affix }})' >> $GITHUB_STEP_SUMMARY
run: >-
if [ "${{ inputs.deploy_list }}" != "" ]; then
for i in ${{ inputs.deploy_list }}; do
echo 'Coverage report for ' $i ':${{ steps.deployment.outputs.page_url }}'$i >> $GITHUB_STEP_SUMMARY
done
else
echo 'Coverage report: (${{ steps.deployment.outputs.page_url }}' >> $GITHUB_STEP_SUMMARY
fi

View File

@ -17,13 +17,19 @@ jobs:
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:
skip_deploy: true
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
result_affix: SMP
skip_deploy: true
deploy:
needs: [tx, smp]
uses: ./.github/workflows/regression_template.yml
with:
skip_test: true
deploy_list: "ThreadX SMP"