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/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 \ 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