-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Add action for Python regression tests (#3820)
* CI: Add action for Python regression tests * WIP: Fix Ubuntu ARM builds * Fix Windows run * WIP: Check self-hosted Ubuntu ARM runners * WIP * WIP: Check own self-hosted Ubuntu ARM runners * Revert WIP * Fix boolean usage * Reduce download logging * Fix * Debug inputs * Reduce upload logging * Remove obsolete parameter * Fix debug inputs * Fix Fedora run * Format
- Loading branch information
Showing
8 changed files
with
137 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
name: Python regression tests | ||
|
||
inputs: | ||
autotest_data_s3_url: | ||
required: false | ||
type: string | ||
default: "s3://data-autotest/test_data_2024-12-19" | ||
build_config: | ||
description: "Build config (Release, Debug)" | ||
required: true | ||
type: string | ||
mrbind: | ||
required: true | ||
type: boolean | ||
pytest_args: | ||
description: "Additional pytest arguments" | ||
required: false | ||
type: string | ||
default: "" | ||
smoke: | ||
required: true | ||
type: boolean | ||
test_artifacts_path: | ||
description: "S3 path for test artifacts. Make sure it is unique for different jobs" | ||
required: true | ||
type: string | ||
ubuntu20_arm_workaround: | ||
description: "Disable specific tests incompatible with Ubuntu 20.04 ARM configuration" | ||
required: false | ||
type: boolean | ||
default: false | ||
upload_test_artifacts: | ||
required: true | ||
type: boolean | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Debug inputs | ||
shell: bash | ||
run: | | ||
echo << EOF | ||
autotest_data_s3_url: ${{ inputs.autotest_data_s3_url }} | ||
build_config: ${{ inputs.build_config }} | ||
mrbind: ${{ inputs.mrbind }} | ||
pytest_args: ${{ inputs.pytest_args }} | ||
smoke: ${{ inputs.smoke }} | ||
test_artifacts_path: ${{ inputs.test_artifacts_path }} | ||
ubuntu20_arm_workaround: ${{ inputs.ubuntu20_arm_workaround }} | ||
upload_test_artifacts: ${{ inputs.upload_test_artifacts }} | ||
EOF | ||
# cache management: https://github.com/MeshInspector/MeshLib/actions/caches | ||
- name: Cache autotest data from S3 Tests | ||
uses: actions/cache@v4 | ||
with: | ||
path: test_data | ||
key: ${{ inputs.autotest_data_s3_url }} | ||
|
||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
role-to-assume: arn:aws:iam::259351611210:role/GitHubMeshLibAwsCredsRole | ||
aws-region: us-east-1 | ||
|
||
- name: Copy autotest data from S3 Tests | ||
shell: bash | ||
run: aws s3 sync ${{ inputs.autotest_data_s3_url }} test_data --delete --no-sign-request --size-only --quiet | ||
|
||
- name: Python Regression Tests | ||
if: ${{ runner.os == 'Windows' }} | ||
shell: powershell | ||
working-directory: source\x64\${{ inputs.build_config }} | ||
run: > | ||
py -3 ..\..\..\scripts\run_python_test_script.py | ||
-d '..\test_regression' | ||
-s ${{ inputs.smoke }} | ||
-bv ${{ fromJSON( inputs.mrbind ) && '3' || '2' }} | ||
-a='${{ inputs.pytest_args }}' | ||
- name: Python Regression Tests | ||
if: ${{ runner.os != 'Windows' }} | ||
shell: bash | ||
working-directory: build/${{ inputs.build_config }}/bin | ||
env: | ||
MR_REGRESSION_TESTS_UBUNTUARM2004_MRBIND_ABI_ISSUES: ${{ fromJSON( inputs.ubuntu20_arm_workaround ) && '1' || '0' }} | ||
run: > | ||
python3 ../../../scripts/run_python_test_script.py | ||
-d '../test_regression' | ||
-s ${{ inputs.smoke }} | ||
-bv ${{ fromJSON( inputs.mrbind ) && '3' || '2' }} | ||
-a='${{ inputs.pytest_args }}' | ||
- name: Copy test artifacts to S3 | ||
if: ${{ fromJSON( inputs.upload_test_artifacts ) && !cancelled() }} | ||
shell: bash | ||
run: aws s3 cp pytest_temp 's3://test-artifacts-git/tests/${{ github.run_id }}/${{ inputs.test_artifacts_path }}' --recursive --quiet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.