GeezerVison is showing github.com — ci: run wasm-wasi snippets and tests from declared lists (#8747) · RustPython/RustPython@2006c63
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: .github/workflows/ci.yaml +28-3Lines changed: 28 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -1024,6 +1024,23 @@ jobs: |
1024 | 1024 | env: |
1025 | 1025 | FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true |
1026 | 1026 | RUN_WASM_WASI: ${{ needs.determine_changes.outputs.rust_code == 'true' || github.ref == 'refs/heads/main' }} |
| 1027 | + # Passing snippets under wasm32-wasip1. |
| 1028 | + WASM_WASI_SNIPPETS: >- |
| 1029 | + stdlib_random |
| 1030 | + stdlib_time |
| 1031 | + # Passing Lib/test files under wasm32-wasip1 |
| 1032 | + WASM_WASI_TEST_FILES: >- |
| 1033 | + test_int |
| 1034 | + test_dict |
| 1035 | + test_exceptions |
| 1036 | + test_copy |
| 1037 | + test_isinstance |
| 1038 | + test_dynamic |
| 1039 | + test_dictviews |
| 1040 | + test_glob |
| 1041 | + test_class |
| 1042 | + test_genericpath |
| 1043 | + test_grammar |
1027 | 1044 | steps: |
1028 | 1045 | - name: Skip wasm-wasi when rust sources did not change |
1029 | 1046 | if: env.RUN_WASM_WASI != 'true' |
@@ -1072,11 +1089,19 @@ jobs: |
1072 | 1089 | - name: run snippets |
1073 | 1090 | if: env.RUN_WASM_WASI == 'true' |
1074 | 1091 | run: | |
1075 | | - wasmer run --volume "$(pwd)" target/wasm32-wasip1/wasm-release/rustpython.wasm -- "$(pwd)/extra_tests/snippets/stdlib_random.py" |
1076 | | - wasmer run --volume "$(pwd)" target/wasm32-wasip1/wasm-release/rustpython.wasm -- "$(pwd)/extra_tests/snippets/stdlib_time.py" |
| 1092 | + for name in $WASM_WASI_SNIPPETS; do |
| 1093 | + echo "::group::extra_tests/snippets/${name}.py" |
| 1094 | + wasmer run --volume "$(pwd)" target/wasm32-wasip1/wasm-release/rustpython.wasm -- "$(pwd)/extra_tests/snippets/${name}.py" |
| 1095 | + echo "::endgroup::" |
| 1096 | + done |
1077 | 1097 | - name: run cpython unittest |
1078 | 1098 | if: env.RUN_WASM_WASI == 'true' |
1079 | | - run: wasmer run --volume "$(pwd)" target/wasm32-wasip1/wasm-release/rustpython.wasm -- "$(pwd)/Lib/test/test_int.py" |
| 1099 | + run: | |
| 1100 | + for name in $WASM_WASI_TEST_FILES; do |
| 1101 | + echo "::group::Lib/test/${name}.py" |
| 1102 | + wasmer run --volume "$(pwd)" target/wasm32-wasip1/wasm-release/rustpython.wasm -- "$(pwd)/Lib/test/${name}.py" |
| 1103 | + echo "::endgroup::" |
| 1104 | + done |
1080 | 1105 |
|
1081 | 1106 | cargo_doc: |
1082 | 1107 | needs: |
|