Skip to content

Commit b21fc5a

Browse files
authored
Move graph_compare logic into tests_ya/action.yml (#8776)
1 parent d25dbce commit b21fc5a

File tree

3 files changed

+25
-34
lines changed

3 files changed

+25
-34
lines changed

.github/actions/build_and_test_ya/action.yml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -95,29 +95,16 @@ runs:
9595
folder_prefix: ya-
9696
build_preset: ${{ inputs.build_preset }}
9797

98-
- name: Generate ya.make with affected test suites and modules list
99-
if: inputs.increment == 'true'
100-
uses: ./.github/actions/graph_compare
101-
102-
- name: Change target in case of incremental
103-
id: target_choice
104-
shell: bash
105-
run: |
106-
if [ "${{ inputs.increment }}" == "true" ]; then
107-
echo "target=." >> $GITHUB_OUTPUT
108-
else
109-
echo "target=${{ inputs.build_target }}" >> $GITHUB_OUTPUT
110-
fi
111-
11298
- name: Run build and tests
11399
id: build
114100
uses: ./.github/actions/test_ya
115101
with:
116-
build_target: ${{ steps.target_choice.outputs.target }}
102+
build_target: ${{ inputs.build_target }}
117103
build_preset: ${{ inputs.build_preset }}
118104
test_size: ${{ inputs.test_size }}
119105
test_type: ${{ inputs.test_type }}
120106
run_tests: ${{ inputs.run_tests }}
107+
increment: ${{ inputs.increment }}
121108
testman_token: ${{ fromJSON( inputs.secs ).TESTMO_TOKEN2 }}
122109
testman_url: ${{ fromJSON( inputs.vars ).TESTMO_URL }}
123110
testman_project_id: ${{ fromJSON( inputs.vars ).TESTMO_PROJECT_ID }}

.github/actions/graph_compare/action.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/actions/test_ya/action.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ inputs:
3636
testman_project_id:
3737
required: false
3838
description: "test manager project id"
39+
increment:
40+
type: boolean
41+
required: true
42+
description: If true, compares build graphs between the current and previous commits to find a list of test suites to run. Otherwise, runs all tests.
3943
put_build_results_to_cache:
4044
required: false
4145
default: "true"
@@ -111,6 +115,24 @@ runs:
111115
echo "NODE_TLS_REJECT_UNAUTHORIZED=0" >> $GITHUB_ENV
112116
fi
113117
118+
- name: Generate ya.make with affected test suites and modules list
119+
if: inputs.increment == 'true'
120+
shell: bash
121+
run: |
122+
ORIGINAL_HEAD=$(git rev-parse HEAD)
123+
./.github/scripts/graph_compare.sh $ORIGINAL_HEAD~1 $ORIGINAL_HEAD
124+
git checkout $ORIGINAL_HEAD
125+
126+
- name: Change target in case of incremental
127+
id: target_choice
128+
shell: bash
129+
run: |
130+
if [ "${{ inputs.increment }}" == "true" ]; then
131+
echo "target=." >> $GITHUB_OUTPUT
132+
else
133+
echo "target=${{ inputs.build_target }}" >> $GITHUB_OUTPUT
134+
fi
135+
114136
- name: ya build and test
115137
id: build
116138
shell: bash
@@ -312,7 +334,7 @@ runs:
312334

313335
CURRENT_JUNIT_XML_PATH=$CURRENT_PUBLIC_DIR/junit.xml
314336
set +ex
315-
(./ya make ${{ inputs.build_target }} "${params[@]}" \
337+
(./ya make ${{ steps.target_choice.outputs.target }} "${params[@]}" \
316338
$RERUN_FAILED_OPT --log-file "$PUBLIC_DIR/ya_log.log" \
317339
--evlog-file "$CURRENT_PUBLIC_DIR/ya_evlog.jsonl" \
318340
--junit "$CURRENT_JUNIT_XML_PATH" --output "$YA_MAKE_OUT_DIR"; echo $? > exit_code) |& cat >> $YA_MAKE_OUTPUT

0 commit comments

Comments
 (0)