File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -137,7 +137,25 @@ jobs:
137137 - name : Run tox
138138 if : ${{ matrix.tool == 'tox' }}
139139 id : tox
140- run : tox
140+ run : |
141+ echo "Running tox for changed files..."
142+ changed_files="${{ needs.check_changes.outputs.files }}"
143+
144+ # Create a temporary tox configuration for the changed files
145+ echo "[testenv]" > tox_pr.ini
146+ echo "commands =" >> tox_pr.ini
147+
148+ # Add specific testing commands for each changed file
149+ for file in $changed_files; do
150+ if [[ $file == *.py ]]; then
151+ echo " pytest {posargs} -xvs $file" >> tox_pr.ini
152+ echo " flake8 $file" >> tox_pr.ini
153+ echo " mypy --ignore-missing-imports $file" >> tox_pr.ini
154+ fi
155+ done
156+
157+ # Run tox with the temporary configuration
158+ tox -c tox_pr.ini || true
141159
142160 summary :
143161 needs : [check_changes, lint]
You can’t perform that action at this time.
0 commit comments