summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiejunZhou <[email protected]>2023-11-24 13:59:26 +0800
committerGitHub <[email protected]>2023-11-24 13:59:26 +0800
commit5f9c713c4805b2fb412889be213fee676f328809 (patch)
treef14f7848efcfeccbd28ccc4be5334e4fe9505ccd
parent11a7db22b4626a4afd183891b2a8f4fa60a137b4 (diff)
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
-rw-r--r--.github/workflows/regression_template.yml74
-rw-r--r--.github/workflows/regression_test.yml14
2 files changed, 71 insertions, 17 deletions
diff --git a/.github/workflows/regression_template.yml b/.github/workflows/regression_template.yml
index 09bf12ad..9d60e0de 100644
--- a/.github/workflows/regression_template.yml
+++ b/.github/workflows/regression_template.yml
@@ -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/[email protected]
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/[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]
@@ -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/[email protected]
+ if: ${{ inputs.skip_deploy }}
+ with:
+ name: coverage_report
+ path: ${{ inputs.cmake_path }}/coverage_report
+ retention-days: 1
+
+ - name: Upload Code Coverage Pages
+ uses: actions/[email protected]
+ 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/[email protected]
+ 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/[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
+ 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 \ No newline at end of file
diff --git a/.github/workflows/regression_test.yml b/.github/workflows/regression_test.yml
index 3da63221..636f089c 100644
--- a/.github/workflows/regression_test.yml
+++ b/.github/workflows/regression_test.yml
@@ -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 \ No newline at end of file
+ result_affix: SMP
+ skip_deploy: true
+ deploy:
+ needs: [tx, smp]
+ uses: ./.github/workflows/regression_template.yml
+ with:
+ skip_test: true
+ deploy_list: "ThreadX SMP" \ No newline at end of file