Skip to content

Commit

Permalink
[Nova] Lint on GHA (#3341)
Browse files Browse the repository at this point in the history
Summary:
See title. If all is well, we can deprecate the CCI job in a few days.

Pull Request resolved: #3341

Reviewed By: mthrok

Differential Revision: D46324265

Pulled By: osalpekar

fbshipit-source-id: bc706c6ae4285d4085dc5f0223ea41d8fc290f1c
  • Loading branch information
osalpekar authored and facebook-github-bot committed May 31, 2023
1 parent 2283df8 commit 5d0697b
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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'
CONDA_PATH=$(which conda)
eval "$(${CONDA_PATH} shell.bash hook)"
conda create --name ci --quiet --yes python=3.8 pip
conda activate ci
echo '::endgroup::'
echo '::group::Install lint tools'
pip install --upgrade pip
pip install --progress-bar=off pre-commit
set +e
pre-commit run --all-files
if [ $? -ne 0 ]; then
git --no-pager diff
exit 1
fi
echo '::endgroup::'
3 changes: 3 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
default_language_version:
node: 16.14.2

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
Expand Down

0 comments on commit 5d0697b

Please sign in to comment.