WIP
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
This commit is contained in:
parent
6db5dee3c3
commit
52dcb06d68
|
@ -31,6 +31,15 @@ jobs:
|
||||||
generate-matrix:
|
generate-matrix:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Parse repository_dispatch payload
|
||||||
|
if: github.event_name == 'repository_dispatch'
|
||||||
|
working-directory: ${{ github.workspace }}
|
||||||
|
run: |
|
||||||
|
if [ ${{ github.event.client_payload.command }} = "ok-to-test" ]; then
|
||||||
|
echo "CHECKOUT_REF=${{ github.event.client_payload.pull_head_ref }}" >> $GITHUB_ENV
|
||||||
|
echo "PR_NUMBER=${{ github.event.client_payload.issue.number }}" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Install yq
|
- name: Install yq
|
||||||
run: |
|
run: |
|
||||||
sudo snap install yq
|
sudo snap install yq
|
||||||
|
@ -113,6 +122,23 @@ jobs:
|
||||||
EOF
|
EOF
|
||||||
)
|
)
|
||||||
echo "::set-output name=cloud-components::$CRON_COMPONENTS"
|
echo "::set-output name=cloud-components::$CRON_COMPONENTS"
|
||||||
|
|
||||||
|
- name: Create PR comment
|
||||||
|
if: env.PR_NUMBER != ''
|
||||||
|
uses: artursouza/sticky-pull-request-comment@v2.2.0
|
||||||
|
with:
|
||||||
|
header: ${{ github.run_id }}
|
||||||
|
number: ${{ env.PR_NUMBER }}
|
||||||
|
hide: true
|
||||||
|
hide_classify: OUTDATED
|
||||||
|
GITHUB_TOKEN: ${{ secrets.DAPR_BOT_TOKEN }}
|
||||||
|
message: |
|
||||||
|
# Components conformance test
|
||||||
|
|
||||||
|
🔗 **[Link to Action run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})**
|
||||||
|
|
||||||
|
Commit ref: ${{ env.CHECKOUT_REF }}
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
pr-components: ${{ steps.pr-components.outputs.pr-components }}
|
pr-components: ${{ steps.pr-components.outputs.pr-components }}
|
||||||
cloud-components: ${{ steps.cloud-components.outputs.cloud-components }}
|
cloud-components: ${{ steps.cloud-components.outputs.cloud-components }}
|
||||||
|
@ -166,6 +192,9 @@ jobs:
|
||||||
echo "TEST_PATH=$TEST_PATH" >> $GITHUB_ENV
|
echo "TEST_PATH=$TEST_PATH" >> $GITHUB_ENV
|
||||||
export SOURCE_PATH="github.com/dapr/components-contrib/${TEST_COMPONENT}"
|
export SOURCE_PATH="github.com/dapr/components-contrib/${TEST_COMPONENT}"
|
||||||
echo "SOURCE_PATH=$SOURCE_PATH" >> $GITHUB_ENV
|
echo "SOURCE_PATH=$SOURCE_PATH" >> $GITHUB_ENV
|
||||||
|
# converts slashes to dots in this string, so that it doesn't consider them sub-folders
|
||||||
|
export SOURCE_PATH_LINEAR=$(echo "$SOURCE_PATH" |sed 's#/#\.#g')
|
||||||
|
echo "SOURCE_PATH_LINEAR=$SOURCE_PATH_LINEAR" >> $GITHUB_ENV
|
||||||
|
|
||||||
- uses: Azure/login@v1
|
- uses: Azure/login@v1
|
||||||
with:
|
with:
|
||||||
|
@ -230,6 +259,9 @@ jobs:
|
||||||
if test $status -ne 0; then
|
if test $status -ne 0; then
|
||||||
echo "Setting CERTIFICATION_FAILURE"
|
echo "Setting CERTIFICATION_FAILURE"
|
||||||
export CERTIFICATION_FAILURE=true
|
export CERTIFICATION_FAILURE=true
|
||||||
|
echo "CERTIFICATION_FAILURE=true" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "CERTIFICATION_FAILURE=false" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
@ -256,12 +288,29 @@ jobs:
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- name: Prepare test result info
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
mkdir -p tmp/result_files
|
||||||
|
if [[ -v ${{ env.CERTIFICATION_FAILURE }} ]]; then
|
||||||
|
echo "0" >> tmp/result_files/${{ matrix.component }}
|
||||||
|
else
|
||||||
|
echo "1" >> tmp/result_files/${{ matrix.component }}
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Upload test result artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
name: result_files
|
||||||
|
path: tmp/result_files
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
- name: Prepare Cert Coverage Info
|
- name: Prepare Cert Coverage Info
|
||||||
if: github.event_name == 'schedule'
|
if: github.event_name == 'schedule'
|
||||||
run: |
|
run: |
|
||||||
mkdir -p tmp/cov_files
|
mkdir -p tmp/cov_files
|
||||||
SOURCE_PATH_LINEAR=$(echo ${{ env.SOURCE_PATH }} |sed 's#/#\.#g') # converts slashes to dots in this string, so that it doesn't consider them sub-folders
|
echo "${{ env.COVERAGE_LINE }}" >> tmp/cov_files/${{ env.SOURCE_PATH_LINEAR }}.txt
|
||||||
echo "${{ env.COVERAGE_LINE }}" >> tmp/cov_files/$SOURCE_PATH_LINEAR.txt
|
|
||||||
|
|
||||||
- name: Upload Cert Coverage Artifact
|
- name: Upload Cert Coverage Artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
|
@ -289,20 +338,39 @@ jobs:
|
||||||
path: ${{ env.TEST_OUTPUT_FILE_PREFIX }}_certification.*
|
path: ${{ env.TEST_OUTPUT_FILE_PREFIX }}_certification.*
|
||||||
|
|
||||||
post_job:
|
post_job:
|
||||||
name: Notify Total coverage
|
name: Post-completion
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: certification
|
needs: certification
|
||||||
if: github.event_name == 'schedule'
|
|
||||||
steps:
|
steps:
|
||||||
|
- name: Parse repository_dispatch payload
|
||||||
|
if: github.event_name == 'repository_dispatch'
|
||||||
|
working-directory: ${{ github.workspace }}
|
||||||
|
run: |
|
||||||
|
if [ ${{ github.event.client_payload.command }} = "ok-to-test" ]; then
|
||||||
|
echo "CHECKOUT_REF=${{ github.event.client_payload.pull_head_ref }}" >> $GITHUB_ENV
|
||||||
|
echo "PR_NUMBER=${{ github.event.client_payload.issue.number }}" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Download test result artifact
|
||||||
|
if: env.PR_NUMBER != ''
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
continue-on-error: true
|
||||||
|
id: download
|
||||||
|
with:
|
||||||
|
name: result_files
|
||||||
|
path: tmp/result_files
|
||||||
|
|
||||||
- name: Download Cert Coverage Artifact
|
- name: Download Cert Coverage Artifact
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
if: github.event_name == 'schedule'
|
||||||
id: download
|
id: download
|
||||||
with:
|
with:
|
||||||
name: certtest_cov
|
name: certtest_cov
|
||||||
path: tmp/cov_files
|
path: tmp/cov_files
|
||||||
|
|
||||||
- name: Calculate total coverage
|
- name: Calculate total coverage
|
||||||
|
if: github.event_name == 'schedule'
|
||||||
run: |
|
run: |
|
||||||
threshold=80.0
|
threshold=80.0
|
||||||
echo "threshold=$threshold" >> $GITHUB_ENV
|
echo "threshold=$threshold" >> $GITHUB_ENV
|
||||||
|
@ -327,11 +395,12 @@ jobs:
|
||||||
done < ${{steps.download.outputs.download-path}}/$f
|
done < ${{steps.download.outputs.download-path}}/$f
|
||||||
done
|
done
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- name: Final Coverage Discord Notification
|
- name: Final Coverage Discord Notification
|
||||||
|
if: github.event_name == 'schedule'
|
||||||
env:
|
env:
|
||||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_MONITORING_WEBHOOK_URL }}
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_MONITORING_WEBHOOK_URL }}
|
||||||
uses: Ilshidur/action-discord@0c4b27844ba47cb1c7bee539c8eead5284ce9fa9
|
uses: Ilshidur/action-discord@0c4b27844ba47cb1c7bee539c8eead5284ce9fa9
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
args: 'Total Coverage for Certification Tests is {{ totalPer }}%. {{ aboveThreshold }} out of {{ totalFiles }} components have certification tests with code coverage > {{ threshold }}%'
|
args: 'Total Coverage for Certification Tests is {{ totalPer }}%. {{ aboveThreshold }} out of {{ totalFiles }} components have certification tests with code coverage > {{ threshold }}%'
|
||||||
|
|
|
@ -31,6 +31,15 @@ jobs:
|
||||||
generate-matrix:
|
generate-matrix:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Parse repository_dispatch payload
|
||||||
|
if: github.event_name == 'repository_dispatch'
|
||||||
|
working-directory: ${{ github.workspace }}
|
||||||
|
run: |
|
||||||
|
if [ ${{ github.event.client_payload.command }} = "ok-to-test" ]; then
|
||||||
|
echo "CHECKOUT_REF=${{ github.event.client_payload.pull_head_ref }}" >> $GITHUB_ENV
|
||||||
|
echo "PR_NUMBER=${{ github.event.client_payload.issue.number }}" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Install yq
|
- name: Install yq
|
||||||
run: |
|
run: |
|
||||||
sudo snap install yq
|
sudo snap install yq
|
||||||
|
@ -133,6 +142,23 @@ jobs:
|
||||||
EOF
|
EOF
|
||||||
)
|
)
|
||||||
echo "::set-output name=cron-components::$CRON_COMPONENTS"
|
echo "::set-output name=cron-components::$CRON_COMPONENTS"
|
||||||
|
|
||||||
|
- name: Create PR comment
|
||||||
|
if: env.PR_NUMBER != ''
|
||||||
|
uses: artursouza/sticky-pull-request-comment@v2.2.0
|
||||||
|
with:
|
||||||
|
header: ${{ github.run_id }}
|
||||||
|
number: ${{ env.PR_NUMBER }}
|
||||||
|
hide: true
|
||||||
|
hide_classify: OUTDATED
|
||||||
|
GITHUB_TOKEN: ${{ secrets.DAPR_BOT_TOKEN }}
|
||||||
|
message: |
|
||||||
|
# Components conformance test
|
||||||
|
|
||||||
|
🔗 **[Link to Action run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})**
|
||||||
|
|
||||||
|
Commit ref: ${{ env.CHECKOUT_REF }}
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
pr-components: ${{ steps.pr-components.outputs.pr-components }}
|
pr-components: ${{ steps.pr-components.outputs.pr-components }}
|
||||||
cron-components: ${{ steps.cron-components.outputs.cron-components }}
|
cron-components: ${{ steps.cron-components.outputs.cron-components }}
|
||||||
|
@ -168,8 +194,9 @@ jobs:
|
||||||
if [ ${{ github.event.client_payload.command }} = "ok-to-test" ]; then
|
if [ ${{ github.event.client_payload.command }} = "ok-to-test" ]; then
|
||||||
echo "CHECKOUT_REPO=${{ github.event.client_payload.pull_head_repo }}" >> $GITHUB_ENV
|
echo "CHECKOUT_REPO=${{ github.event.client_payload.pull_head_repo }}" >> $GITHUB_ENV
|
||||||
echo "CHECKOUT_REF=${{ github.event.client_payload.pull_head_ref }}" >> $GITHUB_ENV
|
echo "CHECKOUT_REF=${{ github.event.client_payload.pull_head_ref }}" >> $GITHUB_ENV
|
||||||
|
echo "PR_NUMBER=${{ github.event.client_payload.issue.number }}" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Check out code onto GOPATH
|
- name: Check out code onto GOPATH
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
|
@ -372,6 +399,8 @@ jobs:
|
||||||
if test $status -ne 0; then
|
if test $status -ne 0; then
|
||||||
echo "Setting CONFORMANCE_FAILURE"
|
echo "Setting CONFORMANCE_FAILURE"
|
||||||
echo "CONFORMANCE_FAILURE=true" >> $GITHUB_ENV
|
echo "CONFORMANCE_FAILURE=true" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "CONFORMANCE_FAILURE=false" >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
@ -423,6 +452,24 @@ jobs:
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- name: Prepare test result info
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
mkdir -p tmp/result_files
|
||||||
|
if [[ -v ${{ env.CONFORMANCE_FAILURE }} ]]; then
|
||||||
|
echo "0" >> tmp/result_files/${{ matrix.component }}
|
||||||
|
else
|
||||||
|
echo "1" >> tmp/result_files/${{ matrix.component }}
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Upload test result artifact
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
if: always()
|
||||||
|
with:
|
||||||
|
name: result_files
|
||||||
|
path: tmp/result_files
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
# Upload logs for test analytics to consume
|
# Upload logs for test analytics to consume
|
||||||
- name: Upload test results
|
- name: Upload test results
|
||||||
if: always()
|
if: always()
|
||||||
|
@ -430,3 +477,26 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.component }}_conformance_test
|
name: ${{ matrix.component }}_conformance_test
|
||||||
path: ${{ env.TEST_OUTPUT_FILE_PREFIX }}_conformance.*
|
path: ${{ env.TEST_OUTPUT_FILE_PREFIX }}_conformance.*
|
||||||
|
|
||||||
|
post_job:
|
||||||
|
name: Post-completion
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: conformance
|
||||||
|
steps:
|
||||||
|
- name: Parse repository_dispatch payload
|
||||||
|
if: github.event_name == 'repository_dispatch'
|
||||||
|
working-directory: ${{ github.workspace }}
|
||||||
|
run: |
|
||||||
|
if [ ${{ github.event.client_payload.command }} = "ok-to-test" ]; then
|
||||||
|
echo "CHECKOUT_REF=${{ github.event.client_payload.pull_head_ref }}" >> $GITHUB_ENV
|
||||||
|
echo "PR_NUMBER=${{ github.event.client_payload.issue.number }}" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Download test result artifact
|
||||||
|
if: env.PR_NUMBER != ''
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
continue-on-error: true
|
||||||
|
id: download
|
||||||
|
with:
|
||||||
|
name: result_files
|
||||||
|
path: tmp/result_files
|
||||||
|
|
Loading…
Reference in New Issue