mirror of
https://github.com/eclipse-threadx/threadx.git
synced 2025-11-16 12:34:48 +00:00
Deploy GitHub pages at last for multiple jobs
This commit is contained in:
65
.github/workflows/regression_template.yml
vendored
65
.github/workflows/regression_template.yml
vendored
@@ -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,10 +80,11 @@ jobs:
|
||||
if: success() || failure()
|
||||
uses: actions/upload-artifact@v3.1.3
|
||||
with:
|
||||
name: test_reports${{ inputs.deploy_url_affix }}
|
||||
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
|
||||
@@ -113,41 +123,56 @@ jobs:
|
||||
|
||||
- name: Prepare GitHub Pages
|
||||
run: >-
|
||||
if [ "${{ inputs.deploy_url_affix }}" != "" ]; then
|
||||
if [ "${{ inputs.result_affix }}" != "" ]; then
|
||||
mv ${{ inputs.cmake_path }}/coverage_report/default_build_coverage \
|
||||
${{ inputs.cmake_path }}/coverage_report/default_build_coverage${{ inputs.deploy_url_affix }}
|
||||
${{ inputs.cmake_path }}/coverage_report/${{ inputs.result_affix }}
|
||||
fi
|
||||
|
||||
# - name: Upload GitHub Pages artifact
|
||||
# uses: actions/upload-pages-artifact@v2.0.0
|
||||
# with:
|
||||
# path: ${{ inputs.cmake_path }}/coverage_report
|
||||
# name: coverage_report${{ inputs.deploy_url_affix }}
|
||||
|
||||
- name: Upload Code Coverage
|
||||
- name: Upload Code Coverage Artifacts
|
||||
uses: actions/upload-artifact@v3.1.3
|
||||
if: ${{ inputs.skip_deploy }}
|
||||
with:
|
||||
name: coverage_report
|
||||
name: github-pages
|
||||
path: ${{ inputs.cmake_path }}/coverage_report
|
||||
|
||||
|
||||
- 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' && false
|
||||
if: ${{ (github.event_name == 'push') && !inputs.skip_deploy && always() }}
|
||||
needs: run_tests
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}/default_build_coverage${{ inputs.deploy_url_affix }}
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
permissions:
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
steps:
|
||||
- uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: github-pages
|
||||
|
||||
- name: Upload Code Coverage Pages
|
||||
uses: actions/upload-pages-artifact@v2.0.0
|
||||
if: inputs.skip_test
|
||||
with:
|
||||
path: .
|
||||
|
||||
- name: Deploy GitHub Pages site
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v1.2.9
|
||||
with:
|
||||
artifact_name: coverage_report${{ inputs.deploy_url_affix }}
|
||||
|
||||
- name: Write Code Coverage Report URL
|
||||
run: |
|
||||
echo '[Open Coverage Report](${{ steps.deployment.outputs.page_url }}/default_build_coverage${{ 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
|
||||
15
.github/workflows/regression_test.yml
vendored
15
.github/workflows/regression_test.yml
vendored
@@ -17,13 +17,20 @@ 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
|
||||
skip_deploy: false
|
||||
deploy_list: "ThreadX SMP"
|
||||
Reference in New Issue
Block a user