1
- # This workflow will run configured tests for any updated MLC script
2
1
name : Test script on modified meta
3
2
4
3
on :
@@ -11,40 +10,52 @@ jobs:
11
10
get_modified_files :
12
11
runs-on : ubuntu-latest
13
12
outputs :
14
- processed_files : ${{ steps.modified-files.outputs.processed_files }}
13
+ processed_files : ${{ steps.filter- modified-files.outputs.processed_files }}
15
14
16
15
steps :
17
- - name : ' Checkout'
18
- uses : actions/checkout@v4
19
- with :
20
- fetch-depth : 2
16
+ - name : Checkout
17
+ uses : actions/checkout@v4
18
+ with :
19
+ fetch-depth : 0
20
+
21
+ - name : Setup Python
22
+ uses : actions/setup-python@v4
23
+ with :
24
+ python-version : ' 3.x'
25
+
26
+ - name : Install dependencies
27
+ run : pip install pyyaml
21
28
22
- - name : Setup Python
23
- uses : actions/setup-python@v2
24
- with :
25
- python-version : ' 3.x'
29
+ - name : Fetch base branch
30
+ run : |
31
+ git fetch origin +refs/heads/${{ github.event.pull_request.base.ref }}:refs/remotes/origin/${{ github.event.pull_request.base.ref }}
26
32
27
- - name : Install dependencies
28
- run : |
29
- pip install pyyaml
33
+ - name : Get list of changed files
34
+ id : modified-files
35
+ run : |
36
+ git diff --name-only origin/${{ github.event.pull_request.base.ref }}...HEAD > changed_files.txt
37
+ files=$(paste -sd, changed_files.txt)
38
+ echo "files=$files" >> $GITHUB_OUTPUT
30
39
31
- - name : Get changed files
32
- id : modified-files
33
- run : |
34
- git remote add upstream ${{ github.event.pull_request.base.repo.clone_url }}
35
- git fetch upstream
36
- changed_files=$(git diff upstream/${{ github.event.pull_request.base.ref }} --name-only)
37
- echo "$changed_files" | python3 .github/scripts/list_modified_files.py
38
-
39
- - name : Debug Show processed_files
40
- run : |
41
- echo "Processed files: '${{ steps.filter-modified-files.outputs.processed_files }}'"
40
+ - name : Filter changed files
41
+ id : filter-modified-files
42
+ env :
43
+ FILES : ${{ steps.modified-files.outputs.files }}
44
+ run : |
45
+ processed=$(echo "$FILES" | python3 .github/scripts/list_modified_files.py)
46
+ echo "processed_files<<EOF" >> $GITHUB_OUTPUT
47
+ echo "$processed" >> $GITHUB_OUTPUT
48
+ echo "EOF" >> $GITHUB_OUTPUT
42
49
50
+ - name : Debug processed_files output
51
+ run : |
52
+ echo "Processed files output:"
53
+ echo "${{ steps.filter-modified-files.outputs.processed_files }}"
43
54
44
55
process_modified_files :
45
- runs-on : ubuntu-latest
46
56
needs : get_modified_files
47
- if : needs.determine_modified_files.outputs.processed_files != '[]' && needs.determine_modified_files.outputs.processed_files != ''
57
+ runs-on : ubuntu-latest
58
+ if : needs.get_modified_files.outputs.processed_files != '[]'
48
59
strategy :
49
60
fail-fast : false
50
61
matrix :
58
69
59
70
- name : Process meta.yaml file
60
71
run : |
61
- echo "Processing ${{ matrix.file_info.file }} with run number ${{ matrix.file_info.num_run }}"
62
-
72
+ echo "Processing ${{ matrix.file_info.file }} (run #${{ matrix.file_info.num_run }})"
63
73
pip install mlcflow
64
74
mlc pull repo ${{ github.event.pull_request.head.repo.html_url }} --branch=${{ github.event.pull_request.head.ref }}
65
- mlc test script ${{ matrix.file_info.uid}} --test_input_index=${{ matrix.file_info.num_run }} --docker_mlc_repo=${{ github.event.pull_request.head.repo.html_url }} --docker_mlc_repo_branch=${{ github.event.pull_request.head.ref }} --quiet
75
+ mlc test script ${{ matrix.file_info.uid }} --test_input_index=${{ matrix.file_info.num_run }} --docker_mlc_repo=${{ github.event.pull_request.head.repo.html_url }} --docker_mlc_repo_branch=${{ github.event.pull_request.head.ref }} --quiet
0 commit comments