Support Intel SDE Tool, improved individual script tests #1
This file contains hidden or 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 workflow will run configured tests for any updated MLC script | ||
name: MLC test script on modified meta | ||
on: | ||
pull_request: | ||
branches: [ "main", "dev" ] | ||
paths: | ||
- 'script/**meta.yaml' | ||
jobs: | ||
get-modified-files: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
modified_files: ${{ steps.modified-files.outputs.modified_files }} | ||
steps: | ||
- name: 'Checkout' | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.x' | ||
- name: Get changed files | ||
id: modified-files | ||
run: | | ||
git remote add upstream ${{ github.event.pull_request.base.repo.clone_url }} | ||
git fetch upstream | ||
changed_files=$(git diff upstream/${{ github.event.pull_request.base.ref }} --name-only) | ||
echo "$changed_files" | python3 .github/scripts/list_modified_files.py | ||
process_modified_files: | ||
runs-on: ubuntu-latest | ||
needs: get_modified_files | ||
strategy: | ||
fail_fast: false | ||
Check failure on line 41 in .github/workflows/run-tests-on-modified-meta.yml
|
||
matrix: | ||
file_info: ${{ fromJSON(needs.get_modified_files.outputs.modified_files) }} | ||
num_run: ${{ range(1, fromJSON(matrix.file_info.num_tests) + 1) }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- name: Process meta.yaml file | ||
run: | | ||
echo "Processing ${{ matrix.file_info.file }} with run number ${{ matrix.num_run }}" | ||
pip install mlcflow | ||
mlc pull repo ${{ github.event.pull_request.head.repo.html_url }} --branch=${{ github.event.pull_request.head.ref }} | ||
mlc test script ${{ matrix.file_info.uid}} --test_input_index=${{ matrix.num_run }} --docker_mlc_repo=${{ github.event.pull_request.head.repo.html_url }} --docker_mlc_repo_branch=${{ github.event.pull_request.head.ref }} --quiet | ||