Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,25 +89,43 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write # for pre-commit-ci/lite-action
contents: write # for pre-commit-ci/lite-action
steps:
- uses: actions/checkout@v5
with:
submodules: recursive
- run: pip install pre-commit
- uses: tj-actions/changed-files@24d32ffd492484c1d75e0c0b894501ddb9d30d62 # v47
id: file_changes
id: tj_file_changes
with:
# Only run pre-commit on EV files themselves, not on submodules
# See https://github.com/EveryVoiceTTS/EveryVoice/issues/555
exclude_submodules: true
- uses: actions/cache@v4 # enable caching for pre-commit
- name: Determine changed files
id: file_changes
run: |
echo "event_name: ${{ github.event_name }}"
case '${{ github.event_name }}' in
pull_request)
echo base.sha ${{ github.event.pull_request.base.sha }} head.sha ${{ github.sha }}
git diff --name-only ${{ github.event.pull_request.base.sha }}...${{ github.sha }}
echo "CHANGED_FILES='$(git diff --name-only ${{ github.event.pull_request.base.sha }}...${{ github.sha }})'" >> $GITHUB_OUTPUT ;;
push)
git diff --name-only HEAD~1...HEAD
echo "CHANGED_FILES='$(git diff --name-only HEAD~1...HEAD)'" >> $GITHUB_OUTPUT ;;
*)
echo other leave it empty
echo "CHANGED_FILES=''" >> $GITHUB_OUTPUT ;;
esac
echo "Changed files: $CHANGED_FILES"
echo "tj-actions/changed-files reported: ${{ steps.tj_file_changes.outputs.all_changed_files }}"
- uses: actions/cache@v4 # enable caching for pre-commit
with:
path: ~/.cache/pre-commit
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Custom replacement for pre-commit/action
# pre-commit/action is not compatible with conda-incubator/setup-miniconda because it sets the shell wrong.
run: python -m pre_commit run --show-diff-on-failure --color=always --files ${{ steps.file_changes.outputs.all_changed_files }}
run: python -m pre_commit run --show-diff-on-failure --color=always --files ${{ steps.file_changes.outputs.CHANGED_FILES }}
- uses: pre-commit-ci/lite-action@5d6cc0eb514c891a40562a58a8e71576c5c7fb43 # v1.1.0
if: always()

Expand Down
Loading