-
Notifications
You must be signed in to change notification settings - Fork 654
37 lines (32 loc) · 939 Bytes
/
lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Lint
on:
pull_request:
push:
branches:
- nightly
- main
- release/*
workflow_dispatch:
jobs:
python-source-and-configs:
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main
with:
repository: pytorch/audio
script: |
set -euo pipefail
echo '::group::Setup environment'
eval "$("$(which conda)" shell.bash hook)"
pip install --progress-bar=off pre-commit
echo '::endgroup::'
set +e
pre-commit run --all-files --show-diff-on-failure
status=$?
echo '::group::Add Summry'
if [ $status -ne 0 ]; then
echo '### Lint failure' >> $GITHUB_STEP_SUMMARY
echo '```diff' >> $GITHUB_STEP_SUMMARY
git --no-pager diff >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
fi
echo '::endgroup::'
exit $status