forked from apache/superset
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): run pre-commit across the repo (apache#26942)
- Loading branch information
1 parent
6990351
commit 4a255e7
Showing
2 changed files
with
54 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: pre-commit checks | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
pull_request: | ||
types: [synchronize, opened, reopened, ready_for_review] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
matrix: | ||
python-version: ["3.9"] | ||
steps: | ||
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )" | ||
uses: actions/checkout@v3 | ||
with: | ||
persist-credentials: false | ||
submodules: recursive | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: "pip" | ||
cache-dependency-path: | | ||
requirements/base.txt | ||
requirements/integration.txt | ||
- name: Install dependencies | ||
uses: ./.github/actions/cached-dependencies | ||
with: | ||
run: | | ||
apt-get-install | ||
pip-upgrade | ||
pip install wheel | ||
pip install -r requirements/base.txt | ||
pip install -r requirements/integration.txt | ||
# Add brew to the path - see https://github.com/actions/runner-images/issues/6283 | ||
- name: Enable brew and helm-docs | ||
run: | | ||
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH | ||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" | ||
echo "HOMEBREW_PREFIX=$HOMEBREW_PREFIX" >>"${GITHUB_ENV}" | ||
echo "HOMEBREW_CELLAR=$HOMEBREW_CELLAR" >>"${GITHUB_ENV}" | ||
echo "HOMEBREW_REPOSITORY=$HOMEBREW_REPOSITORY" >>"${GITHUB_ENV}" | ||
brew install norwoodj/tap/helm-docs | ||
- name: pre-commit | ||
run: | | ||
if ! pre-commit run --all-files; then | ||
git status | ||
git diff | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters